[docs] [issue23864] issubclass without registration only works for "one-trick pony" collections ABCs.

Antti Haapala report at bugs.python.org
Sat Apr 4 13:30:16 CEST 2015


Antti Haapala added the comment:

This does apply to all versions of Python from 2.6 up. Registering does work of course.

I believe the reason for not having the __subclasshook__ is the following sentence in PEP 3119: "ABCs are intended to solve problems that don't have a good solution at all in Python 2, such as distinguishing between mappings and sequences."

This used to be worse in <3.3 because there if you ever inherit from `Sequence` you will always end up having `__dict__`, even if you just want `__slots__`.

(By the way, if Py2 documentation is fixed, it should also say that these ABCs are new as of 2.6, not since 2.4 like the rest of the collections module).

----------
nosy: +ztane

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23864>
_______________________________________


More information about the docs mailing list