]> granicus.if.org Git - python/commitdiff
file.write() may return something with the new IO framework.
authorGeorg Brandl <georg@python.org>
Fri, 21 Mar 2008 19:42:31 +0000 (19:42 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 21 Mar 2008 19:42:31 +0000 (19:42 +0000)
Doc/library/stdtypes.rst

index f06ca2c6b822b583da8791ed3cc1ce10168575bb..18131b905ff98d82fd7f7bddfb120f31d613323a 100644 (file)
@@ -2055,9 +2055,13 @@ Files have the following methods:
 
 .. method:: file.write(str)
 
-   Write a string to the file.  There is no return value.  Due to buffering, the
-   string may not actually show up in the file until the :meth:`flush` or
-   :meth:`close` method is called.
+   Write a string to the file.  Due to buffering, the string may not actually
+   show up in the file until the :meth:`flush` or :meth:`close` method is
+   called.
+
+   The meaning of the return value is not defined for every file-like object.
+   Some (mostly low-level) file-like objects may return the number of bytes
+   actually written, others return ``None``.
 
 
 .. method:: file.writelines(sequence)