Issue 22671: Typo in class io.BufferedIOBase docs (original) (raw)

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:09 admin set github: 66861
2017-12-12 18🔞22 CuriousLearner set pull_requests: + <pull%5Frequest4708>
2017-12-11 14:28:11 vstinner set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2017-12-11 14:27:32 vstinner set messages: +
2017-12-11 13:44:02 python-dev set pull_requests: + <pull%5Frequest4695>
2017-12-11 13:42:16 vstinner set nosy: + vstinnermessages: +
2017-11-26 07:32:43 CuriousLearner set pull_requests: + <pull%5Frequest4496>
2017-10-29 03:06:50 martin.panter set messages: +
2017-10-28 12:09:09 serhiy.storchaka set versions: + Python 3.6, Python 3.7, - Python 3.4, Python 3.5nosy: + serhiy.storchakamessages: + assignee: docs@python -> martin.panter
2015-04-02 00:05:06 martin.panter set files: + read-defaults.v3.patchmessages: +
2015-01-27 02:19:11 berker.peksag set nosy: + berker.peksagstage: needs patch -> patch review
2014-12-22 23:31:12 martin.panter set files: + read-defaults.v2.patchmessages: +
2014-12-20 12:30:29 martin.panter set files: + read-defaults.patchnosy: + martin.pantermessages: + keywords: + patch
2014-12-20 07:06:15 chkumar246 set nosy: + chkumar246
2014-11-02 16:03:31 ezio.melotti set keywords: + easynosy: + pitroustage: needs patchversions: + Python 3.5, - Python 3.3
2014-10-19 09:35:52 gigaplastik create