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: Typo in class io.BufferedIOBase docs
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: martin.panter Nosy List: berker.peksag, chkumar246, docs@python, gigaplastik, martin.panter, pitrou, serhiy.storchaka, vstinner
Priority: normal Keywords: easy, patch

Created on 2014-10-19 09:35 by gigaplastik, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
read-defaults.patch martin.panter, 2014-12-20 12:30 review
read-defaults.v2.patch martin.panter, 2014-12-22 23:31 review
read-defaults.v3.patch martin.panter, 2015-04-02 00:05 review
Pull Requests
URL Status Linked Edit
PR 4568 merged CuriousLearner, 2017-11-26 07:32
PR 4796 merged python-dev, 2017-12-11 13:44
PR 4818 closed CuriousLearner, 2017-12-12 18:18
Messages (9)
msg229677 - (view) Author: gigaplastik (gigaplastik) * Date: 2014-10-19 09:35
The online documentation for class io.BufferedIOBase states the following:

"Besides, the read() method does not have a default implementation that defers to readinto()."

According to the documentation for class io.RawIOBase (which the statement compares with) read() method actually defers to readall(), NOT readinto() as misleadingly stated.
The same typo is present in help('io.BufferedIOBase') output and, very likely, in all 3.X line docs for this class.
msg232970 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2014-12-20 12:30
The documentation was technically correct but too scanty. RawIOBase.read(-1) does defer to readall(), but with a proper size passed, it defers to readinto() instead. Here is a patch which hopefully clarifies this, and also explains which methods have a usable default implementation. Includes some tests for RawIOBase and BufferedIOBase which didn’t seem to be there already.
msg233029 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2014-12-22 23:31
Adding patch v2 with readinto1() as a “mixin method” and dropped many of my earlier changes for better consistency with the introduction of the classes (which I never really read before :P)
msg239863 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-04-02 00:05
read-defaults.v3.patch:
* Split off test_RawIOBase_readall()
* Changed BufferedIOBase tests to matrix of tuples
* Added tests for empty buffer
* Test that unused part of buffer remains untouched
msg305159 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-28 12:09
Do you mind to create a PR Martin?
msg305172 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-10-29 03:06
I’m unlikely to soon, but I don’t mind if someone else uses my patch.
msg308042 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-11 13:42
New changeset 1b74f9b77a6fa1d7828986cb79d5b10942ff9141 by Victor Stinner (Sanyam Khurana) in branch 'master':
bpo-22671: Clarify and test default read method implementations (#4568)
https://github.com/python/cpython/commit/1b74f9b77a6fa1d7828986cb79d5b10942ff9141
msg308044 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-11 14:27
New changeset 0aa2a1d003b476b954ecdcb7e966bf7f0b75a06b by Victor Stinner (Miss Islington (bot)) in branch '3.6':
bpo-22671: Clarify and test default read method implementations (GH-4568) (#4796)
https://github.com/python/cpython/commit/0aa2a1d003b476b954ecdcb7e966bf7f0b75a06b
msg308045 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-11 14:28
Thank you Martin Panter and Sanyam Khurana for the fix.
History
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66861
2017-12-12 18:18:22CuriousLearnersetpull_requests: + pull_request4708
2017-12-11 14:28:11vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg308045

stage: patch review -> resolved
2017-12-11 14:27:32vstinnersetmessages: + msg308044
2017-12-11 13:44:02python-devsetpull_requests: + pull_request4695
2017-12-11 13:42:16vstinnersetnosy: + vstinner
messages: + msg308042
2017-11-26 07:32:43CuriousLearnersetpull_requests: + pull_request4496
2017-10-29 03:06:50martin.pantersetmessages: + msg305172
2017-10-28 12:09:09serhiy.storchakasetversions: + Python 3.6, Python 3.7, - Python 3.4, Python 3.5
nosy: + serhiy.storchaka

messages: + msg305159

assignee: docs@python -> martin.panter
2015-04-02 00:05:06martin.pantersetfiles: + read-defaults.v3.patch

messages: + msg239863
2015-01-27 02:19:11berker.peksagsetnosy: + berker.peksag

stage: needs patch -> patch review
2014-12-22 23:31:12martin.pantersetfiles: + read-defaults.v2.patch

messages: + msg233029
2014-12-20 12:30:29martin.pantersetfiles: + read-defaults.patch

nosy: + martin.panter
messages: + msg232970

keywords: + patch
2014-12-20 07:06:15chkumar246setnosy: + chkumar246
2014-11-02 16:03:31ezio.melottisetkeywords: + easy
nosy: + pitrou
stage: needs patch

versions: + Python 3.5, - Python 3.3
2014-10-19 09:35:52gigaplastikcreate