[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki
INADA Naoki added the comment: I think PySequence_Check() has same problem. OTOH, mapping definition says: > A container object that supports arbitrary key lookups and implements the > methods specified in the Mapping or MutableMapping abstract base classes. - http://docs.python.org/3.3/glossa

[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread Michele OrrĂ¹
Changes by Michele OrrĂ¹ : -- nosy: +maker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Careful, though: dict also provides these methods, but I would not consider it a Sequence. -- nosy: +amaury.forgeotdarc ___ Python tracker __

[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki
INADA Naoki added the comment: In Python 3.3: In [33]: issubclass(Foo, collections.abc.Sequence) Out[33]: False -- ___ Python tracker ___ ___

[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/glossary.html#term-sequence __getitem__ and __len__ are required for sequence type. (__iter__ is not required because types having __getitem__ are already iterator.) .__contains__(), .index() and .count() is not required for sequence.