Antoon Pardon wrote: > Second tryal, I hope the formatting doesn't get messed up now > > Playing around with the collections and collections.abc modules in > python3.4 I stumbled upon the following: > >>>> from collections.abc import Sequence >>>> from collections import deque >>>> isinstance(list(), Sequence) > True >>>> isinstance(deque(), Sequence) > False > > This seems strange to me. As far as I understand, the > documentation indicates there is no reason why deque > shouldn't be a subclass of Sequence. > > Am I missing something or can this be considered a bug?
>>> from collections import deque >>> from collections.abc import Sequence >>> [name for name in set(dir(Sequence)) - set(dir(deque)) if not name.startswith("_")] ['index'] So the index() method seems to be what is missing. -- https://mail.python.org/mailman/listinfo/python-list