[Python-checkins] r54739 - peps/trunk/pep-3116.txt
guido.van.rossum
python-checkins at python.org
Tue Apr 10 22:58:54 CEST 2007
Author: guido.van.rossum
Date: Tue Apr 10 22:58:53 2007
New Revision: 54739
Modified:
peps/trunk/pep-3116.txt
Log:
Like seek(), truncate() always returns the new current position.
All write() methods return the number of bytes/characters written
(for buffered and text files, this is always the lenth of the input).
Modified: peps/trunk/pep-3116.txt
==============================================================================
--- peps/trunk/pep-3116.txt (original)
+++ peps/trunk/pep-3116.txt Tue Apr 10 22:58:53 2007
@@ -86,7 +86,7 @@
``.tell() -> int``
- ``.truncate(n: int = None) -> None``
+ ``.truncate(n: int = None) -> int``
``.close() -> None``
@@ -162,17 +162,17 @@
``.readinto(b: bytes) -> int``
- ``.write(b: bytes) -> None``
+ ``.write(b: bytes) -> int``
Write ``b`` bytes to the buffer. The bytes are not guaranteed to
be written to the Raw I/O object immediately; they may be
- buffered.
+ buffered. Returns ``len(b)``.
``.seek(pos: int, whence: int = 0) -> int``
``.tell() -> int``
- ``.truncate(pos: int = None) -> None``
+ ``.truncate(pos: int = None) -> int``
``.flush() -> None``
@@ -275,7 +275,7 @@
``.read(n: int = -1) -> str``
- ``.write(s: str) -> None``
+ ``.write(s: str) -> int``
``.tell() -> object``
@@ -288,7 +288,7 @@
Seek to position ``pos``. If ``pos`` is non-zero, it must
be a cookie returned from ``.tell()`` and ``whence`` must be zero.
- ``.truncate(pos: object = None) -> None``
+ ``.truncate(pos: object = None) -> int``
Like ``BufferedIOBase.truncate()``, except that ``pos`` (if
not ``None``) must be a cookie previously returned by ``.tell()``.
More information about the Python-checkins
mailing list