@@ -1842,52 +1842,53 @@ in the Python API that may require changes to your Python code.
1842
1842
Porting notes for the C API are
1843
1843
:ref: `listed separately <whatsnew311-c-api-porting >`.
1844
1844
1845
- * Prohibited passing non-:class: `concurrent.futures.ThreadPoolExecutor `
1846
- executors to :meth: `loop.set_default_executor ` following a deprecation in
1847
- Python 3.8.
1848
- (Contributed by Illia Volochii in :issue: `43234 `.)
1849
-
1850
1845
* :func: `open `, :func: `io.open `, :func: `codecs.open ` and
1851
1846
:class: `fileinput.FileInput ` no longer accept ``'U' `` ("universal newline")
1852
- in the file mode. This flag was deprecated since Python 3.3. In Python 3, the
1853
- "universal newline" is used by default when a file is open in text mode. The
1854
- :ref: `newline parameter <open-newline-parameter >` of :func: `open ` controls
1855
- how universal newlines works.
1847
+ in the file mode. In Python 3, "universal newline" mode is used by default
1848
+ whenever a file is opened in text mode,
1849
+ and the ``'U' `` flag has been deprecated since Python 3.3.
1850
+ The :ref: `newline parameter <open-newline-parameter >`
1851
+ to these functions controls how universal newlines work.
1856
1852
(Contributed by Victor Stinner in :issue: `37330 `.)
1857
1853
1858
- * The :mod: `pdb ` module now reads the :file: `.pdbrc ` configuration file with
1859
- the ``'utf-8' `` encoding.
1860
- (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue: `41137 `.)
1854
+ * :class: `ast.AST ` node positions are now validated when provided to
1855
+ :func: `compile ` and other related functions. If invalid positions are detected,
1856
+ a :exc: `ValueError ` will be raised. (Contributed by Pablo Galindo in :gh: `93351 `)
1857
+
1858
+ * Prohibited passing non-:class: `concurrent.futures.ThreadPoolExecutor `
1859
+ executors to :meth: `asyncio.loop.set_default_executor `
1860
+ following a deprecation in Python 3.8.
1861
+ (Contributed by Illia Volochii in :issue: `43234 `.)
1861
1862
1862
1863
* :mod: `calendar `: The :class: `calendar.LocaleTextCalendar ` and
1863
1864
:class: `calendar.LocaleHTMLCalendar ` classes now use
1864
1865
:func: `locale.getlocale `, instead of using :func: `locale.getdefaultlocale `,
1865
1866
if no locale is specified.
1866
1867
(Contributed by Victor Stinner in :issue: `46659 `.)
1867
1868
1868
- * Global inline flags (e.g. ``(?i) ``) can now only be used at the start of
1869
- the regular expressions. Using them not at the start of expression was
1870
- deprecated since Python 3.6.
1871
- (Contributed by Serhiy Storchaka in :issue: `47066 `.)
1872
-
1873
- * :mod: `re ` module: Fix a few long-standing bugs where, in rare cases,
1874
- capturing group could get wrong result. So the result may be different than
1875
- before.
1876
- (Contributed by Ma Lin in :issue: `35859 `.)
1869
+ * The :mod: `pdb ` module now reads the :file: `.pdbrc ` configuration file with
1870
+ the ``'UTF-8' `` encoding.
1871
+ (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) in :issue: `41137 `.)
1877
1872
1878
- * The *population * parameter of :func: `random.sample ` must be a sequence.
1879
- Automatic conversion of sets to lists is no longer supported. If the sample size
1873
+ * The *population * parameter of :func: `random.sample ` must be a sequence,
1874
+ and automatic conversion of :class: `set `\s to :class: `list `\s
1875
+ is no longer supported. Also, if the sample size
1880
1876
is larger than the population size, a :exc: `ValueError ` is raised.
1881
1877
(Contributed by Raymond Hettinger in :issue: `40465 `.)
1882
1878
1883
- * :class: ` ast.AST ` node positions are now validated when provided to
1884
- :func: ` compile ` and other related functions. If invalid positions are detected,
1885
- a :exc: ` ValueError ` will be raised. (Contributed by Pablo Galindo in :gh: ` 93351 `)
1879
+ * The * random * optional parameter of :func: ` random.shuffle ` was removed.
1880
+ It was previously an arbitrary random function to use for the shuffle;
1881
+ now, :func: ` random.random ` (its previous default) will always be used.
1886
1882
1887
- * :c:member: `~PyTypeObject.tp_dictoffset ` should be treated as write-only.
1888
- It can be set to describe C extension clases to the VM, but should be regarded
1889
- as meaningless when read. To get the pointer to the object's dictionary call
1890
- :c:func: `PyObject_GenericGetDict ` instead.
1883
+ * In :mod: `re ` :ref: `re-syntax `, global inline flags (e.g. ``(?i) ``)
1884
+ can now only be used at the start of regular expressions.
1885
+ Using them elsewhere has been deprecated since Python 3.6.
1886
+ (Contributed by Serhiy Storchaka in :issue: `47066 `.)
1887
+
1888
+ * In the :mod: `re ` module, several long-standing bugs where fixed that,
1889
+ in rare cases, could cause capture groups to get the wrong result.
1890
+ Therefore, this could change the captured output in these cases.
1891
+ (Contributed by Ma Lin in :issue: `35859 `.)
1891
1892
1892
1893
1893
1894
.. _whatsnew311-build-changes :
0 commit comments