This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: `issubclass(collections.deque, collections.Sequence) == False`
Type: Stage:
Components: Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: cool-RR, eric.araujo, r.david.murray, rhettinger
Priority: normal Keywords:

Created on 2011-07-12 19:16 by cool-RR, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg140206 - (view) Author: Ram Rachum (cool-RR) * Date: 2011-07-12 19:16
Is there a good reason that `issubclass(collections.deque, collections.Sequence) == False`? What's not-sequence-y about `deque`?
msg140214 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-07-12 20:47
Maybe they don't support all Sequence operations?  They don't support slicing, certainly, but I can't tell from the collections ABC docs if Sequence is required to support slicing.
msg140216 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-07-12 23:08
index() isn't supported.
msg140588 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-18 14:31
> They don't support slicing, certainly, but I can't tell from the
> collections ABC docs if Sequence is required to support slicing.

This looks like a 2.7 docs bug.  The table with ABCs mentions __*item__, but not __*slice__, probably because it was written with 3.x in mind (where slices are a type of __*item__).  Do you think we need to improve the documentation for slicing, in general and with regards to collections ABCs?
msg140642 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-07-19 01:30
Éric, this is not a doc bug.  The sequence ABCs do not require slicing support.
msg140656 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-19 12:17
> The sequence ABCs do not require slicing support.
Understood, but is it said in the docs?  David said that he couldn’t find that bit of info, which is why I suggested a doc bug.
History
Date User Action Args
2022-04-11 14:57:19adminsetgithub: 56752
2011-07-19 12:17:51eric.araujosetmessages: + msg140656
2011-07-19 01:30:38rhettingersetmessages: + msg140642
2011-07-18 14:31:28eric.araujosetnosy: + eric.araujo
messages: + msg140588
2011-07-12 23:08:34rhettingersetstatus: open -> closed
assignee: rhettinger
resolution: not a bug
messages: + msg140216
2011-07-12 20:47:49r.david.murraysetnosy: + r.david.murray, rhettinger
messages: + msg140214
2011-07-12 19:16:10cool-RRcreate