This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JelleZijlstra
Recipients JelleZijlstra, docs@python, rhettinger, xiang.zhang
Date 2016-06-05.18:45:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465152309.73.0.0854071801086.issue27215@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-06-05 18:45:09JelleZijlstrasetrecipients: + JelleZijlstra, rhettinger, docs@python, xiang.zhang
2016-06-05 18:45:09JelleZijlstrasetmessageid: <1465152309.73.0.0854071801086.issue27215@psf.upfronthosting.co.za>
2016-06-05 18:45:09JelleZijlstralinkissue27215 messages
2016-06-05 18:45:09JelleZijlstracreate