Skip to content

Commit 1beab50

Browse files
gh-95913: Edit, sort & expand 3.11 WhatsNew Porting section (GH-98585)
(cherry picked from commit 43bef54) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
1 parent ae68a45 commit 1beab50

File tree

1 file changed

+31
-30
lines changed

1 file changed

+31
-30
lines changed

Doc/whatsnew/3.11.rst

+31-30
Original file line numberDiff line numberDiff line change
@@ -1827,52 +1827,53 @@ in the Python API that may require changes to your Python code.
18271827
Porting notes for the C API are
18281828
:ref:`listed separately <whatsnew311-c-api-porting>`.
18291829

1830-
* Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor`
1831-
executors to :meth:`loop.set_default_executor` following a deprecation in
1832-
Python 3.8.
1833-
(Contributed by Illia Volochii in :issue:`43234`.)
1834-
18351830
* :func:`open`, :func:`io.open`, :func:`codecs.open` and
18361831
:class:`fileinput.FileInput` no longer accept ``'U'`` ("universal newline")
1837-
in the file mode. This flag was deprecated since Python 3.3. In Python 3, the
1838-
"universal newline" is used by default when a file is open in text mode. The
1839-
:ref:`newline parameter <open-newline-parameter>` of :func:`open` controls
1840-
how universal newlines works.
1832+
in the file mode. In Python 3, "universal newline" mode is used by default
1833+
whenever a file is opened in text mode,
1834+
and the ``'U'`` flag has been deprecated since Python 3.3.
1835+
The :ref:`newline parameter <open-newline-parameter>`
1836+
to these functions controls how universal newlines work.
18411837
(Contributed by Victor Stinner in :issue:`37330`.)
18421838

1843-
* The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with
1844-
the ``'utf-8'`` encoding.
1845-
(Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue:`41137`.)
1839+
* :class:`ast.AST` node positions are now validated when provided to
1840+
:func:`compile` and other related functions. If invalid positions are detected,
1841+
a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:`93351`)
1842+
1843+
* Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor`
1844+
executors to :meth:`asyncio.loop.set_default_executor`
1845+
following a deprecation in Python 3.8.
1846+
(Contributed by Illia Volochii in :issue:`43234`.)
18461847

18471848
* :mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and
18481849
:class:`calendar.LocaleHTMLCalendar` classes now use
18491850
:func:`locale.getlocale`, instead of using :func:`locale.getdefaultlocale`,
18501851
if no locale is specified.
18511852
(Contributed by Victor Stinner in :issue:`46659`.)
18521853

1853-
* Global inline flags (e.g. ``(?i)``) can now only be used at the start of
1854-
the regular expressions. Using them not at the start of expression was
1855-
deprecated since Python 3.6.
1856-
(Contributed by Serhiy Storchaka in :issue:`47066`.)
1857-
1858-
* :mod:`re` module: Fix a few long-standing bugs where, in rare cases,
1859-
capturing group could get wrong result. So the result may be different than
1860-
before.
1861-
(Contributed by Ma Lin in :issue:`35859`.)
1854+
* The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with
1855+
the ``'UTF-8'`` encoding.
1856+
(Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue:`41137`.)
18621857

1863-
* The *population* parameter of :func:`random.sample` must be a sequence.
1864-
Automatic conversion of sets to lists is no longer supported. If the sample size
1858+
* The *population* parameter of :func:`random.sample` must be a sequence,
1859+
and automatic conversion of :class:`set`\s to :class:`list`\s
1860+
is no longer supported. Also, if the sample size
18651861
is larger than the population size, a :exc:`ValueError` is raised.
18661862
(Contributed by Raymond Hettinger in :issue:`40465`.)
18671863

1868-
* :class:`ast.AST` node positions are now validated when provided to
1869-
:func:`compile` and other related functions. If invalid positions are detected,
1870-
a :exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:`93351`)
1864+
* The *random* optional parameter of :func:`random.shuffle` was removed.
1865+
It was previously an arbitrary random function to use for the shuffle;
1866+
now, :func:`random.random` (its previous default) will always be used.
18711867

1872-
* :c:member:`~PyTypeObject.tp_dictoffset` should be treated as write-only.
1873-
It can be set to describe C extension clases to the VM, but should be regarded
1874-
as meaningless when read. To get the pointer to the object's dictionary call
1875-
:c:func:`PyObject_GenericGetDict` instead.
1868+
* In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``)
1869+
can now only be used at the start of regular expressions.
1870+
Using them elsewhere has been deprecated since Python 3.6.
1871+
(Contributed by Serhiy Storchaka in :issue:`47066`.)
1872+
1873+
* In the :mod:`re` module, several long-standing bugs where fixed that,
1874+
in rare cases, could cause capture groups to get the wrong result.
1875+
Therefore, this could change the captured output in these cases.
1876+
(Contributed by Ma Lin in :issue:`35859`.)
18761877

18771878

18781879
.. _whatsnew311-build-changes:

0 commit comments

Comments
 (0)