Jelle Zijlstra added the comment:

The docstrings (at least in 3.6) say subclasses must override __new__ *or* 
__init__. However, I think this is wrong too. The following is a correct (if 
not very useful) implementation of Sequence:

>>> import collections.abc
>>> class MySequence(collections.abc.Sequence):
...     def __getitem__(self, key):
...             raise IndexError(key)
...     def __len__(self):
...             return 0
... 

Other abc docstrings also don't claim that __init__ or __new__ must be 
implemented. The attached patch fixes the docstrings.

----------
keywords: +patch
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file43245/issue27215.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27215>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to