diff options
author | Charles-François Natali <neologix@free.fr> | 2011-06-08 17:18:14 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-06-08 17:18:14 (GMT) |
commit | 4dd453c6aab315954f19bf0b2f1541c2b37d8e34 (patch) | |
tree | 6123dfbe0ffc22f81ca942e357e128f36216ab29 /Doc/library/mmap.rst | |
parent | dd696496605883a44da983ad81e55a01e996a004 (diff) | |
download | cpython-4dd453c6aab315954f19bf0b2f1541c2b37d8e34.zip cpython-4dd453c6aab315954f19bf0b2f1541c2b37d8e34.tar.gz cpython-4dd453c6aab315954f19bf0b2f1541c2b37d8e34.tar.bz2 |
Issue #12021: Make mmap's read() method argument optional. Patch by Petri
Lehtinen.
Diffstat (limited to 'Doc/library/mmap.rst')
-rw-r--r-- | Doc/library/mmap.rst | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index 7a901c9..7708028 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -190,12 +190,16 @@ To map anonymous memory, -1 should be passed as the fileno along with the length move will raise a :exc:`TypeError` exception. - .. method:: read(num) + .. method:: read([n]) - Return a :class:`bytes` containing up to *num* bytes starting from the - current file position; the file position is updated to point after the - bytes that were returned. + Return a :class:`bytes` containing up to *n* bytes starting from the + current file position. If the argument is omitted, *None* or negative, + return all bytes from the current file position to the end of the + mapping. The file position is updated to point after the bytes that were + returned. + .. versionchanged:: 3.3 + Argument can be omitted or *None*. .. method:: read_byte() |