[issue27598] Add SizedIterable to collections.abc and typing

Guido van Rossum report at bugs.python.org
Thu Aug 18 11:16:55 EDT 2016


Guido van Rossum added the comment:

I thought about this some more. It won't work because when a class method
is called via super(), 'cls' is still set to the derived class (and in
general for class methods that's the right thing to do, just as it is for
regular methods that self is still the actual object). If you read my
previous long comment you'll understand that all the __subclasshook__
methods carefully return NotImplemented immediately if their 'cls' argument
is not the class where they are defined. So it won't work.

I also don't see the use case (you're not supposed to do this at home,
basically).

----------

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


More information about the Python-bugs-list mailing list