diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2008-01-19 18:18:41 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2008-01-19 18:18:41 (GMT) |
commit | 5c60bfcfbf2dd50cc40210771fdc8d2cfc20cdad (patch) | |
tree | 906959917e2562717aa503edee65d6462a6d5682 /Doc | |
parent | 4be0bc642e89939d9d9bf2559d92eafe9f0a0933 (diff) | |
download | cpython-5c60bfcfbf2dd50cc40210771fdc8d2cfc20cdad.zip cpython-5c60bfcfbf2dd50cc40210771fdc8d2cfc20cdad.tar.gz cpython-5c60bfcfbf2dd50cc40210771fdc8d2cfc20cdad.tar.bz2 |
Patch #976880: add mmap .rfind() method, and 'end' paramter to .find().
Contributed by John Lenton.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/mmap.rst | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index 070ce4f..cdc761c 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -139,11 +139,12 @@ Memory-mapped file objects support the following methods: an exception being raised. -.. method:: mmap.find(string[, start]) +.. method:: mmap.find(string[, start[, end]]) - Returns the lowest index in the object where the substring *string* is found. - Returns ``-1`` on failure. *start* is the index at which the search begins, and - defaults to zero. + Returns the lowest index in the object where the substring *string* is found, + such that *string* is contained in the range [*start*, *end*]. Optional + arguments *start* and *end* are interpreted as in slice notation. + Returns ``-1`` on failure. .. method:: mmap.flush([offset, size]) @@ -188,6 +189,14 @@ Memory-mapped file objects support the following methods: :exc:`TypeError` exception. +.. method:: mmap.rfind(string[, start[, end]]) + + Returns the highest index in the object where the substring *string* is + found, such that *string* is contained in the range [*start*, + *end*]. Optional arguments *start* and *end* are interpreted as in slice + notation. Returns ``-1`` on failure. + + .. method:: mmap.seek(pos[, whence]) Set the file's current position. *whence* argument is optional and defaults to |