On 07/04/2016 10:25, Antoon Pardon wrote:
the index() method seems to be added in 3.5, so is deque
a subclass of Sequence in 3.5?
Yes, this http://bugs.python.org/issue23704 refers.
Use the builtin
https://docs.python.org/3/library/functions.html#issubclass to try it.
>>> issubclass(deque
On 2016-04-07 11:12, Peter Otten wrote:
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 impor
Antoon Pardon wrote:
> Op 07-04-16 om 11:12 schreef Peter Otten:
>>
> 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
Op 07-04-16 om 11:12 schreef Peter Otten:
>
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.
the index() method
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(li
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