diff -r 5a9f2de4dc16 Doc/tutorial/inputoutput.rst --- a/Doc/tutorial/inputoutput.rst Sun Jan 03 19:37:07 2016 +0530 +++ b/Doc/tutorial/inputoutput.rst Mon Jan 04 07:35:46 2016 +0530 @@ -271,7 +271,7 @@ ``f`` has already been created. To read a file's contents, call ``f.read(size)``, which reads some quantity of -data and returns it as a string or bytes object. *size* is an optional numeric +data and returns it as a string (in text mode) or bytes object (in binary mode). *size* is an optional numeric argument. When *size* is omitted or negative, the entire contents of the file will be read and returned; it's your problem if the file is twice as large as your machine's memory. Otherwise, at most *size* bytes are read and returned. @@ -315,8 +315,7 @@ >>> f.write('This is a test\n') 15 -To write something other than a string, it needs to be converted to a string -first:: +To write something other than a string (in text mode) or bytes object (in binary mode), it needs to be converted first to string or bytes object respectively. :: >>> value = ('the answer', 42) >>> s = str(value)