diff options
Diffstat (limited to 'Doc/library/mmap.rst')
-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 9e552fd..37391d0 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -137,11 +137,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]) @@ -186,6 +187,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 |