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.

classification
Title: io.py: Improve docstrings for classes
Type: enhancement Stage: resolved
Components: IO Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, berker.peksag, pitrou, python-dev, r.david.murray, vstinner
Priority: normal Keywords: easy, patch

Created on 2014-04-14 20:50 by akuchling, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
io-copy-docstrings.patch akuchling, 2014-04-14 20:50 Copy __doc__ from parent class review
Messages (6)
msg216210 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2014-04-14 20:50
io.py contains the following to declare ABCs for some of its classes:

class IOBase(_io._IOBase, metaclass=abc.ABCMeta):
    pass

(and similarly for RawIOBase, BufferedIOBase, TextIOBase).

_io._IOBase has an extensive docstring, but IOBase doesn't. (Python doesn't inherit parent-class docstrings, on the theory that the subclass may change things that make the docstring invalid.)

I propose the attached patch.
msg216970 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-04-21 20:48
Looks good to me.
msg217159 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-04-25 13:29
New changeset e33a036fd784 by Andrew Kuchling in branch '3.4':
#21225: copy docstrings from base classes
http://hg.python.org/cpython/rev/e33a036fd784
msg217263 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-04-27 14:01
Can this be closed? (or needs backport to 2.7? http://hg.python.org/cpython/file/2.7/Lib/io.py#l69)
msg217427 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-04-28 22:21
New changeset 6e23afdee4e4 by Andrew Kuchling in branch '2.7':
#21225: copy docstrings from base classes
http://hg.python.org/cpython/rev/6e23afdee4e4
msg217428 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-04-28 22:21
I've backported Andrew's change.
History
Date User Action Args
2022-04-11 14:58:01adminsetgithub: 65424
2014-04-28 22:21:36pitrousetstatus: open -> closed

nosy: + pitrou
messages: + msg217428

resolution: fixed
stage: patch review -> resolved
2014-04-28 22:21:05python-devsetmessages: + msg217427
2014-04-27 14:01:47berker.peksagsetnosy: + berker.peksag
messages: + msg217263
2014-04-27 00:32:27vstinnersetnosy: + vstinner
2014-04-25 13:29:45python-devsetnosy: + python-dev
messages: + msg217159
2014-04-21 22:56:47pitrousetversions: + Python 3.4
2014-04-21 20:48:53r.david.murraysetnosy: + r.david.murray
messages: + msg216970
2014-04-15 19:59:54akuchlingsetcomponents: + IO
versions: + Python 2.7, Python 3.5
2014-04-14 20:50:46akuchlingcreate