diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-28 19:53:35 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-28 19:53:35 (GMT) |
commit | ece349e51777ebc086c8f194fdb7d20f29daf445 (patch) | |
tree | 4feb9aa043feeffacfd967685b8068d5547dd8c5 /Doc/library/io.rst | |
parent | ed9204346e02a2353752a38bf0381b622938c0bb (diff) | |
download | cpython-ece349e51777ebc086c8f194fdb7d20f29daf445.zip cpython-ece349e51777ebc086c8f194fdb7d20f29daf445.tar.gz cpython-ece349e51777ebc086c8f194fdb7d20f29daf445.tar.bz2 |
State clearly that truncate() doesn't move the file position,
and remove a duplicate of its specification.
Diffstat (limited to 'Doc/library/io.rst')
-rw-r--r-- | Doc/library/io.rst | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst index cf5e9f7..9f08c25 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) |