Message257418
About section "7.2.1. Methods of File Objects" of the tutorial:
1. Method read() is documented as follows:
reads some quantity of data and returns it as a string or bytes object.
Indeed read() returns a string in text mode and bytes in binary mode. For the sake of clarity, I suggest changing to:
reads some quantity of data and returns it as a string (in text mode) or bytes object (in binary mode).
This might seem long-winded but I believe it would help those moving from Python 2 to Python 3.
2. Method write() is documented as follows:
To write something other than a string, it needs to be converted to a string first
While this is correct in text mode, it is wrong in binary mode. May I suggest:
To write something other than a string (in text mode) or bytes object (in binary mode), it needs to be converted first |
|
Date |
User |
Action |
Args |
2016-01-03 13:56:15 | Dimitri Papadopoulos Orfanos | set | recipients:
+ Dimitri Papadopoulos Orfanos, docs@python |
2016-01-03 13:56:15 | Dimitri Papadopoulos Orfanos | set | messageid: <1451829375.45.0.0188699168911.issue26001@psf.upfronthosting.co.za> |
2016-01-03 13:56:15 | Dimitri Papadopoulos Orfanos | link | issue26001 messages |
2016-01-03 13:56:14 | Dimitri Papadopoulos Orfanos | create | |
|