[issue27215] Docstrings of Sequence and MutableSequence seems not right

2016-06-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I think you're reading too much into the docs.  Most useful classes provide a 
__new__ or __init__ to put data into instances.  The docs are simply saying 
that that responsibility lies with the implementer rather than with the ABC.

IMO, the docs are more useful as-is.  Were we to accept the patch, it wouldn't 
be long before another user reported a bug saying that the implemented the 
other methods but the class didn't do anything useful.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27215] Docstrings of Sequence and MutableSequence seems not right

2016-06-05 Thread Jelle Zijlstra

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27215] Docstrings of Sequence and MutableSequence seems not right

2016-06-04 Thread ppperry

Changes by ppperry :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27215] Docstrings of Sequence and MutableSequence seems not right

2016-06-04 Thread ppperry

Changes by ppperry :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27215] Docstrings of Sequence and MutableSequence seems not right

2016-06-04 Thread Xiang Zhang

New submission from Xiang Zhang:

Docstrings of Sequence and MutableSequence in collections.abc says "Concrete 
subclasses must provide __new__ and __init__". This seems not the truth. Not 
providing __new__ and __init__ is also OK.

--
messages: 267249
nosy: rhettinger, xiang.zhang
priority: normal
severity: normal
status: open
title: Docstrings of Sequence and MutableSequence seems not right

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com