Title: Typo in class io.BufferedIOBase docs
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: martin.panter Nosy List: berker.peksag, chkumar246, docs@python, gigaplastik, martin.panter, pitrou, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2014-10-19 09:35 by gigaplastik, last changed 2017-10-29 03:06 by martin.panter.

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
Messages (6)
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. 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
* 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.
Date User Action Args
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