[docs] Behavior of ZipFile with file-like object and BufferedWriter. (issue 20699)
storchaka at gmail.com
storchaka at gmail.com
Thu May 19 02:45:20 EDT 2016
http://bugs.python.org/review/20699/diff/16966/Doc/library/io.rst
File Doc/library/io.rst (right):
http://bugs.python.org/review/20699/diff/16966/Doc/library/io.rst#newcode597
Doc/library/io.rst:597: The argument *initial_bytes* is a
:term:`bytes-like object` that
Maybe "The optional argument"?
http://bugs.python.org/review/20699/diff/16966/Lib/_pyio.py
File Lib/_pyio.py (right):
http://bugs.python.org/review/20699/diff/16966/Lib/_pyio.py#newcode678
Lib/_pyio.py:678: """Read bytes into buffer *b*, using at most one
system call
Should this be unified with readinto()?
http://bugs.python.org/review/20699/diff/16966/Lib/test/test_io.py
File Lib/test/test_io.py (right):
http://bugs.python.org/review/20699/diff/16966/Lib/test/test_io.py#newcode320
Lib/test/test_io.py:320: self.assertEqual(memoryview(data).tobytes(), b"
worl")
Maybe just "bytes(data)"?
http://bugs.python.org/review/20699/diff/16966/Lib/test/test_io.py#newcode667
Lib/test/test_io.py:667: def make_file_writer():
Current testing code is 16 lines long, but if expand loop and inline
factories it would 15 lines long (and look more clear to me).
Yet more short and clear writing is:
def check(f):
with f:
self.assertEqual(f.write(a), n)
f.writelines((a,))
check(self.BytesIO())
check(self.FileIO(support.TESTFN, "w"))
...
Only 9 lines!
http://bugs.python.org/review/20699/
More information about the docs
mailing list