[Python-checkins] r80591 - python/trunk/Doc/library/io.rst

antoine.pitrou python-checkins at python.org
Wed Apr 28 21:53:35 CEST 2010


Author: antoine.pitrou
Date: Wed Apr 28 21:53:35 2010
New Revision: 80591

Log:
State clearly that truncate() doesn't move the file position, 
and remove a duplicate of its specification.



Modified:
   python/trunk/Doc/library/io.rst

Modified: python/trunk/Doc/library/io.rst
==============================================================================
--- python/trunk/Doc/library/io.rst	(original)
+++ python/trunk/Doc/library/io.rst	Wed Apr 28 21:53:35 2010
@@ -319,7 +319,9 @@
    .. method:: truncate(size=None)
 
       Truncate the file to at most *size* bytes.  *size* defaults to the current
-      file position, as returned by :meth:`tell`.
+      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.
 
    .. method:: writable()
 
@@ -527,11 +529,6 @@
 
       In :class:`BytesIO`, this is the same as :meth:`read`.
 
-   .. method:: truncate([size])
-
-      Truncate the buffer to at most *size* bytes.  *size* defaults to the
-      current stream position, as returned by :meth:`tell`.
-
 
 .. class:: BufferedReader(raw, buffer_size=DEFAULT_BUFFER_SIZE)
 


More information about the Python-checkins mailing list