From: Antoine Pitrou Date: Wed, 28 Apr 2010 19:53:35 +0000 (+0000) Subject: State clearly that truncate() doesn't move the file position, X-Git-Tag: v2.7b2~153 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ece349e51777ebc086c8f194fdb7d20f29daf445;p=thirdparty%2FPython%2Fcpython.git State clearly that truncate() doesn't move the file position, and remove a duplicate of its specification. --- diff --git a/Doc/library/io.rst b/Doc/library/io.rst index cf5e9f766d21..9f08c25219c3 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -319,7 +319,9 @@ I/O Base Classes .. 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 many situations, buffered I/O streams will provide higher performance 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)