[issue7022] Doc update for io module
report at bugs.python.org
Wed Sep 30 08:52:42 CEST 2009
New submission from Pascal Chambon <chambon.pascal at gmail.com>:
*Propositions of doc update*
*RawIOBase*.read(n: int) -> bytes
Read up to n bytes from the object and return them. Fewer than n bytes
may be returned if the operating system call returns fewer than n bytes.
If 0 bytes are returned, and n was not 0, this indicates end of file. If
the object is in non-blocking mode and no bytes are available, the call
<warning - this proposition requires patching teh current implementation
*RawIOBase*.readinto(b: bytearray, [start: int = None], [end: int =
None]) -> int
start and end are used as slice indexes, so that the bytearray taken
into account is actually range = b[start:end] (or b[start:], b[:end] or
b[:], depending on the arguments which are not None).
Read up to len(range) bytes from the object and store them in b, returning
the number of bytes read. Like .read, fewer than len(range) bytes may be
read, and 0 indicates end of file if len(range) is not 0.
None is returned if a non-blocking object has no bytes available. The
length of b is never changed.
components: Documentation, IO
nosy: georg.brandl, pakal
title: Doc update for io module
type: feature request
versions: Python 3.1, Python 3.2
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list