From e50e41f7d6f944d224aedf29064cba9c04ecdc3f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 30 Aug 2026 23:43:41 +0300 Subject: [PATCH 1/2] gh-151914: Copyedit "What's new in Python 3.16" (#156678) --- Doc/whatsnew/3.16.rst | 116 ++++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index f3ddae7a2b2fdd..4c432fb249f246 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -120,6 +120,16 @@ codecs even when a built-in codec of the same name exists. (Contributed by Serhiy Storchaka in :gh:`152997`.) + +concurrent.futures +------------------ + +* The iterator returned by :meth:`concurrent.futures.Executor.map` is no longer + automatically closed if a function call raises an exception. + Use method :meth:`!close` to explicitly close the iterator. + (Contributed by xzmeng and Serhiy Storchaka in :gh:`108518`.) + + csv --- @@ -140,6 +150,19 @@ csv instead of always returning ``'\r\n'``. (Contributed by Serhiy Storchaka in :gh:`75008`.) + +ctypes +------ + +* Add :func:`ctypes.util.struct` for generating :class:`~ctypes.Structure` types + from an annotation-based syntax, similar to how the :mod:`dataclasses` module + is used. + (Contributed by Peter Bierma in :gh:`104533`.) +* Add :func:`ctypes.util.wrap_dll_function` for generating function pointers + through a function signature. + (Contributed by Peter Bierma in :gh:`153903`.) + + curses ------ @@ -274,27 +297,6 @@ curses (Contributed by Serhiy Storchaka in :gh:`133031`.) -ctypes ------- - -* Add :func:`ctypes.util.struct` for generating :class:`~ctypes.Structure` types - from an annotation-based syntax, similar to how the :mod:`dataclasses` module - is used. - (Contributed by Peter Bierma in :gh:`104533`.) -* Add :func:`ctypes.util.wrap_dll_function` for generating function pointers - through a function signature. - (Contributed by Peter Bierma in :gh:`153903`.) - - -concurrent.futures ------------------- - -* The iterator returned by :meth:`concurrent.futures.Executor.map` is no longer - automatically closed if a function call raises an exception. - Use method :meth:`!close` to explicitly close the iterator. - (Contributed by xzmeng and Serhiy Storchaka in :gh:`108518`.) - - encodings --------- @@ -310,12 +312,6 @@ gzip which is passed on to the constructor of the :class:`~gzip.GzipFile` class. (Contributed by Marin Misur in :gh:`91372`.) -io --- - -* Add :meth:`io.BytesIO.peek` method to read without advancing position. - (Contributed by Marcel Martin in :gh:`90533`.) - imaplib ------- @@ -368,12 +364,20 @@ imaplib (Contributed by Serhiy Storchaka in :gh:`153521`.) +io +-- + +* Add :meth:`io.BytesIO.peek` method to read without advancing position. + (Contributed by Marcel Martin in :gh:`90533`.) + + ipaddress --------- -Add :meth:`~ipaddress.IPv4Network.next_network` and -:meth:`~ipaddress.IPv6Network.next_network` methods to find the next nearest -network with a specific prefix size. +* Add :meth:`~ipaddress.IPv4Network.next_network` and + :meth:`~ipaddress.IPv6Network.next_network` methods to find the next nearest + network with a specific prefix size. + (Contributed by Faisal Mahmood in :gh:`87027`.) logging @@ -413,16 +417,15 @@ math multiprocessing --------------- -* Add the optional ``buffersize`` parameter to +* Add the optional *buffersize* parameter to :meth:`multiprocessing.pool.Pool.imap` and :meth:`multiprocessing.pool.Pool.imap_unordered` to limit the number of submitted tasks whose results have not yet been yielded. If the buffer is - full, iteration over the *iterables* pauses until a result is yielded from + full, iteration over the *iterable* pauses until a result is yielded from the buffer. To fully utilize pool's capacity when using this feature, set *buffersize* at least to the number of processes in pool (to consume *iterable* as you go), or even higher (to prefetch the next ``N=buffersize-processes`` arguments). - (Contributed by Oleksandr Baltian in :gh:`136871`.) @@ -471,6 +474,7 @@ shlex a string, even if it is already safe for a shell without being quoted. (Contributed by Jay Berry in :gh:`148846`.) + sqlite3 ------- @@ -479,6 +483,7 @@ sqlite3 :exc:`SystemError` or :exc:`ValueError`. (Contributed by Jiseok CHOI in :gh:`150449`.) + symtable -------- @@ -673,12 +678,6 @@ re (Contributed by Serhiy Storchaka in :gh:`152033` and Pieter Eendebak in :gh:`152056`.) -module_name ------------ - -* TODO - - Removed ======== @@ -719,22 +718,27 @@ asyncio functools --------- -* Calling the Python implementation of :func:`functools.reduce` with *function* - or *sequence* as keyword arguments has been deprecated since Python 3.14. +* Remove support for calling the Python implementation of + :func:`functools.reduce` with *function* or *sequence* as keyword arguments, + deprecated since Python 3.14. These parameters are now positional-only. + (Contributed by Nikita Sobolev in :gh:`149537`.) logging ------- -* Support for custom logging handlers with the *strm* argument is deprecated - and scheduled for removal in Python 3.16. Define handlers with the *stream* - argument instead. +* Remove support for custom logging handlers with the *strm* argument, + deprecated since Python 3.14. + Define handlers with the *stream* argument instead. + (Contributed by Nikita Sobolev in :gh:`149598`.) mimetypes --------- -* Valid extensions start with a '.' or are empty for - :meth:`mimetypes.MimeTypes.add_type`. - Undotted extensions now raise a :exc:`ValueError`. +* Remove support for undotted extensions in + :meth:`mimetypes.MimeTypes.add_type`, deprecated since Python 3.14. + Valid extensions must now start with a ``'.'`` or be empty; + undotted extensions raise a :exc:`ValueError`. + (Contributed by Nikita Sobolev in :gh:`149720`.) shutil ------ @@ -791,14 +795,14 @@ Deprecated New deprecations ---------------- -* :mod:`abc` +* :mod:`abc`: - * Soft-deprecated since Python 3.3 :class:`abc.abstractclassmethod`, - :class:`abc.abstractstaticmethod`, and :class:`abc.abstractproperty` + * :class:`abc.abstractclassmethod`, :class:`abc.abstractstaticmethod`, + and :class:`abc.abstractproperty`, soft-deprecated since Python 3.3, now raise a :exc:`DeprecationWarning`. - These classes will be removed in Python 3.21, instead + These classes will be removed in Python 3.21; use :func:`abc.abstractmethod` with :func:`classmethod`, - :func:`staticmethod`, and :class:`property` respectively. + :func:`staticmethod`, and :class:`property` respectively instead. * :mod:`ast`: @@ -813,12 +817,12 @@ New deprecations * :mod:`struct`: - * Soft-deprecated since Python 3.15, using ``'F'`` and ``'D'`` type codes are now - deprecated. These codes will be removed in Python 3.21. Use instead - two-letter forms ``'Zf'`` and ``'Zd'``. + * The ``'F'`` and ``'D'`` type codes, soft-deprecated since Python 3.15, + are now deprecated. These codes will be removed in Python 3.21. + Use the two-letter forms ``'Zf'`` and ``'Zd'`` instead. (Contributed by Sergey B Kirpichev in :gh:`121249`.) -* :mod:`tempfile` +* :mod:`tempfile`: * The private ``tempfile._TemporaryFileWrapper`` name is deprecated and is slated for removal in Python 3.21. From 03503dccd0aa6d8895614e80ae9c78c03c813d45 Mon Sep 17 00:00:00 2001 From: sai Date: Mon, 31 Aug 2026 03:13:38 +0530 Subject: [PATCH 2/2] gh-156676: Skip `test_pyinit_function_raises_exception` for other implementations (GH-156684) See also https://github.com/RustPython/RustPython/pull/8605 --- Lib/test/test_import/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index 7e92028cb955cb..65c425c1d29721 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -2544,6 +2544,7 @@ def test_disallowed_reimport(self): excsnap = _interpreters.run_string(interpid, script) self.assertIsNot(excsnap, None) + @cpython_only @requires_subinterpreters def test_pyinit_function_raises_exception(self): # gh-144601: PyInit functions that raised exceptions would cause a