[Python-checkins] r81595 - in python/branches/py3k: Doc/library/io.rst

antoine.pitrou python-checkins at python.org
Sat May 29 14:08:25 CEST 2010


Author: antoine.pitrou
Date: Sat May 29 14:08:25 2010
New Revision: 81595

Log:
Merged revisions 81594 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81594 | antoine.pitrou | 2010-05-29 14:06:13 +0200 (sam., 29 mai 2010) | 3 lines
  
  Issue #8840: Make documentation for truncate() clearer
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Doc/library/io.rst

Modified: python/branches/py3k/Doc/library/io.rst
==============================================================================
--- python/branches/py3k/Doc/library/io.rst	(original)
+++ python/branches/py3k/Doc/library/io.rst	Sat May 29 14:08:25 2010
@@ -314,10 +314,12 @@
 
    .. method:: truncate(size=None)
 
-      Truncate the file to at most *size* bytes.  *size* defaults to the current
-      file position, as returned by :meth:`tell`.  Note that the current file
-      position isn't changed; if you want to change it to the new end of
-      file, you have to :meth:`seek()` explicitly.
+      Resize the stream to the given *size* in bytes (or the current position
+      if *size* is not specified).  The current stream position isn't changed.
+      This resizing can extend or reduce the current file size.  In case of
+      extension, the contents of the new file area depend on the platform
+      (on most systems, additional bytes are zero-filled, on Windows they're
+      undetermined).  The new file size is returned.
 
    .. method:: writable()
 


More information about the Python-checkins mailing list