@@ -1827,52 +1827,53 @@ in the Python API that may require changes to your Python code.
1827
1827
Porting notes for the C API are
1828
1828
:ref: `listed separately <whatsnew311-c-api-porting >`.
1829
1829
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
-
1835
1830
* :func: `open `, :func: `io.open `, :func: `codecs.open ` and
1836
1831
: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.
1841
1837
(Contributed by Victor Stinner in :issue: `37330 `.)
1842
1838
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 `.)
1846
1847
1847
1848
* :mod: `calendar `: The :class: `calendar.LocaleTextCalendar ` and
1848
1849
:class: `calendar.LocaleHTMLCalendar ` classes now use
1849
1850
:func: `locale.getlocale `, instead of using :func: `locale.getdefaultlocale `,
1850
1851
if no locale is specified.
1851
1852
(Contributed by Victor Stinner in :issue: `46659 `.)
1852
1853
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 `.)
1862
1857
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
1865
1861
is larger than the population size, a :exc: `ValueError ` is raised.
1866
1862
(Contributed by Raymond Hettinger in :issue: `40465 `.)
1867
1863
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.
1871
1867
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 `.)
1876
1877
1877
1878
1878
1879
.. _whatsnew311-build-changes :
0 commit comments