From 6069534f552ccfedb60006b38d868a5a8bc703b5 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 24 Oct 2022 02:09:39 -0500 Subject: [PATCH 1/4] Fix/improve Sphinx syntax and grammar/phrasing for Porting items --- Doc/whatsnew/3.11.rst | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 79afc1f99e99d9..c895abcf0bf513 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1766,20 +1766,21 @@ Porting notes for the C API are :ref:`listed separately `. * Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` - executors to :meth:`loop.set_default_executor` following a deprecation in - Python 3.8. + executors to :meth:`asyncio.loop.set_default_executor` + following a deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.) * :func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal newline") - in the file mode. This flag was deprecated since Python 3.3. In Python 3, the - "universal newline" is used by default when a file is open in text mode. The - :ref:`newline parameter ` of :func:`open` controls - how universal newlines works. + in the file mode. In Python 3, "universal newline" mode is used by default + whenever a file is opened in text mode, + and the ``'U'`` flag has been deprecated since Python 3.3. + The :ref:`newline parameter ` + to these functions controls how universal newlines work. (Contributed by Victor Stinner in :issue:`37330`.) * The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with - the ``'utf-8'`` encoding. + the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue:`41137`.) * :mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and @@ -1788,18 +1789,19 @@ Porting notes for the C API are if no locale is specified. (Contributed by Victor Stinner in :issue:`46659`.) -* Global inline flags (e.g. ``(?i)``) can now only be used at the start of - the regular expressions. Using them not at the start of expression was - deprecated since Python 3.6. +* In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) + can now only be used at the start of regular expressions. + Using them elsewhere has been deprecated since Python 3.6. (Contributed by Serhiy Storchaka in :issue:`47066`.) -* :mod:`re` module: Fix a few long-standing bugs where, in rare cases, - capturing group could get wrong result. So the result may be different than - before. +* In the :mod:`re` module, several long-standing bugs where fixed that, + in rare cases, could cause capture groups to get the wrong result. + Therefore, this could change the captured output in these cases. (Contributed by Ma Lin in :issue:`35859`.) -* The *population* parameter of :func:`random.sample` must be a sequence. - Automatic conversion of sets to lists is no longer supported. If the sample size +* The *population* parameter of :func:`random.sample` must be a sequence, + and automatic conversion of :class:`set`\s to :class:`list`\s + is no longer supported. Also, if the sample size is larger than the population size, a :exc:`ValueError` is raised. (Contributed by Raymond Hettinger in :issue:`40465`.) @@ -1808,8 +1810,8 @@ Porting notes for the C API are a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:`93351`) * :c:member:`~PyTypeObject.tp_dictoffset` should be treated as write-only. - It can be set to describe C extension clases to the VM, but should be regarded - as meaningless when read. To get the pointer to the object's dictionary call + It can be set to describe C extension classwa to the VM, but should be regarded + as meaningless when read. To get the pointer to the object's dictionary, call :c:func:`PyObject_GenericGetDict` instead. From 08607601638af140e0361e1d498731ecd774dbcc Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 24 Oct 2022 02:11:11 -0500 Subject: [PATCH 2/4] Sort items by module alphabetically, with builtins at the top --- Doc/whatsnew/3.11.rst | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index c895abcf0bf513..ccb337e5024c0e 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1765,11 +1765,6 @@ in the Python API that may require changes to your Python code. Porting notes for the C API are :ref:`listed separately `. -* Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` - executors to :meth:`asyncio.loop.set_default_executor` - following a deprecation in Python 3.8. - (Contributed by Illia Volochii in :issue:`43234`.) - * :func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal newline") in the file mode. In Python 3, "universal newline" mode is used by default @@ -1779,9 +1774,14 @@ Porting notes for the C API are to these functions controls how universal newlines work. (Contributed by Victor Stinner in :issue:`37330`.) -* The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with - the ``'UTF-8'`` encoding. - (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue:`41137`.) +* :class:`ast.AST` node positions are now validated when provided to + :func:`compile` and other related functions. If invalid positions are detected, + a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:`93351`) + +* Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` + executors to :meth:`asyncio.loop.set_default_executor` + following a deprecation in Python 3.8. + (Contributed by Illia Volochii in :issue:`43234`.) * :mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:`calendar.LocaleHTMLCalendar` classes now use @@ -1789,6 +1789,16 @@ Porting notes for the C API are if no locale is specified. (Contributed by Victor Stinner in :issue:`46659`.) +* The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with + the ``'UTF-8'`` encoding. + (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue:`41137`.) + +* The *population* parameter of :func:`random.sample` must be a sequence, + and automatic conversion of :class:`set`\s to :class:`list`\s + is no longer supported. Also, if the sample size + is larger than the population size, a :exc:`ValueError` is raised. + (Contributed by Raymond Hettinger in :issue:`40465`.) + * In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now only be used at the start of regular expressions. Using them elsewhere has been deprecated since Python 3.6. @@ -1799,16 +1809,6 @@ Porting notes for the C API are Therefore, this could change the captured output in these cases. (Contributed by Ma Lin in :issue:`35859`.) -* The *population* parameter of :func:`random.sample` must be a sequence, - and automatic conversion of :class:`set`\s to :class:`list`\s - is no longer supported. Also, if the sample size - is larger than the population size, a :exc:`ValueError` is raised. - (Contributed by Raymond Hettinger in :issue:`40465`.) - -* :class:`ast.AST` node positions are now validated when provided to - :func:`compile` and other related functions. If invalid positions are detected, - a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:`93351`) - * :c:member:`~PyTypeObject.tp_dictoffset` should be treated as write-only. It can be set to describe C extension classwa to the VM, but should be regarded as meaningless when read. To get the pointer to the object's dictionary, call From c1ae7cba6470180669e3fc8c123f05e82de88adf Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 24 Oct 2022 02:11:55 -0500 Subject: [PATCH 3/4] Remove out of place C API change added to Python Porting section --- Doc/whatsnew/3.11.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index ccb337e5024c0e..2478be019420d9 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1809,11 +1809,6 @@ Porting notes for the C API are Therefore, this could change the captured output in these cases. (Contributed by Ma Lin in :issue:`35859`.) -* :c:member:`~PyTypeObject.tp_dictoffset` should be treated as write-only. - It can be set to describe C extension classwa to the VM, but should be regarded - as meaningless when read. To get the pointer to the object's dictionary, call - :c:func:`PyObject_GenericGetDict` instead. - .. _whatsnew311-build-changes: From fb9b90bf6aa8ea5c5eb2e1337a53391aa0f19cff Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 24 Oct 2022 02:19:02 -0500 Subject: [PATCH 4/4] Add random.shuffle random parameter change to Porting section --- Doc/whatsnew/3.11.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 2478be019420d9..e290c57fe0c588 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1799,6 +1799,10 @@ Porting notes for the C API are is larger than the population size, a :exc:`ValueError` is raised. (Contributed by Raymond Hettinger in :issue:`40465`.) +* The *random* optional parameter of :func:`random.shuffle` was removed. + It was previously an arbitrary random function to use for the shuffle; + now, :func:`random.random` (its previous default) will always be used. + * In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now only be used at the start of regular expressions. Using them elsewhere has been deprecated since Python 3.6.