State clearly that truncate() doesn't move the file position,

and remove a duplicate of its specification.
This commit is contained in:
Antoine Pitrou 2010-04-28 19:53:35 +00:00
parent ed9204346e
commit ece349e517
1 changed files with 3 additions and 6 deletions

View File

@ -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)