summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2023-11-09 11:13:35 (GMT)
committerGitHub <noreply@github.com>2023-11-09 11:13:35 (GMT)
commit6046aec377311efb89c4438f7cf412e2c6568ba1 (patch)
tree07068685c50a1dda084f3d1fcd89e9279afa6a49 /Doc
parent30ec968befde2313f66af4754d410dc5a080a20a (diff)
downloadcpython-6046aec377311efb89c4438f7cf412e2c6568ba1.zip
cpython-6046aec377311efb89c4438f7cf412e2c6568ba1.tar.gz
cpython-6046aec377311efb89c4438f7cf412e2c6568ba1.tar.bz2
gh-111835: Add seekable method to mmap.mmap (gh-111852)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/mmap.rst8
-rw-r--r--Doc/whatsnew/3.13.rst8
2 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
index 4ca7a64..3fa69e7 100644
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -285,6 +285,14 @@ To map anonymous memory, -1 should be passed as the fileno along with the length
values are ``os.SEEK_CUR`` or ``1`` (seek relative to the current
position) and ``os.SEEK_END`` or ``2`` (seek relative to the file's end).
+ .. versionchanged:: 3.13
+ Return the new absolute position instead of ``None``.
+
+ .. method:: seekable()
+
+ Return whether the file supports seeking, and the return value is always ``True``.
+
+ .. versionadded:: 3.13
.. method:: size()
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 428b648..ae3c88d 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -198,6 +198,14 @@ ipaddress
* Add the :attr:`ipaddress.IPv4Address.ipv6_mapped` property, which returns the IPv4-mapped IPv6 address.
(Contributed by Charles Machalow in :gh:`109466`.)
+mmap
+----
+
+* The :class:`mmap.mmap` class now has an :meth:`~mmap.mmap.seekable` method
+ that can be used where it requires a file-like object with seekable and
+ the :meth:`~mmap.mmap.seek` method return the new absolute position.
+ (Contributed by Donghee Na and Sylvie Liberman in :gh:`111835`.)
+
opcode
------