From: Zackery Spytz Date: Thu, 4 Sep 2025 15:52:24 +0000 (-0700) Subject: gh-87595: Fix the docs for mmap.size() (#138494) X-Git-Tag: v3.15.0a1~490 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d6b94afe7d835f406ab86c7fee1cb7fdb87922b;p=thirdparty%2FPython%2Fcpython.git gh-87595: Fix the docs for mmap.size() (#138494) Correct some parts of the docs added in 32032ee376 that weren't written by me. --- diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst index d9d401a2789c..9c0b828fbd4d 100644 --- a/Doc/library/mmap.rst +++ b/Doc/library/mmap.rst @@ -324,10 +324,10 @@ To map anonymous memory, -1 should be passed as the fileno along with the length Return the length of the file, which can be larger than the size of the memory-mapped area. - For anonymous mapping, return its size. + For an anonymous mapping, return its size. .. versionchanged:: next - Supports anonymous mapping on Unix. + Anonymous mappings are now supported on Unix. .. method:: tell() diff --git a/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst b/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst index a6221ba9c885..0919e2c6ae1d 100644 --- a/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst +++ b/Misc/NEWS.d/next/Library/2021-03-07-16-31-36.bpo-43429.Koa0mf.rst @@ -1,5 +1,5 @@ The :meth:`~mmap.mmap.size` method of the :class:`mmap.mmap` class now returns the size of an anonymous mapping on both Unix and Windows. Previously, the size would be returned on Windows and an :exc:`OSError` -would be raised on Unix. -Raise :exc:`ValueError` instead of :exc:`OSError` with ``trackfd=False``. +would be raised on Unix. :exc:`ValueError` is now raised instead of +:exc:`OSError` when ``trackfd=False``.