Skip to content

Commit 98eef50

Browse files
CAM-Gerlachpablogsal
authored andcommitted
gh-95913: Prepare remaining Whatsnew sections for editing (#98342)
* Add line breaks & ref targets to Whatsnew to prepare for future changes * Use standard heading underbar symbols for H4 sections * Flatten Porting subsection; clarify scope of/link Python->CAPI sections * Move C API pending deprecations to C API section, to match the others
1 parent 25ebe35 commit 98eef50

File tree

1 file changed

+105
-28
lines changed

1 file changed

+105
-28
lines changed

Doc/whatsnew/3.11.rst

Lines changed: 105 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ New Modules
561561
(Contributed by Sebastian Rittau in :issue:`42012`.)
562562

563563

564+
.. _whatsnew311-improved-modules:
565+
564566
Improved Modules
565567
================
566568

@@ -1093,6 +1095,8 @@ fcntl
10931095
the ``FD_CLOEXEC`` flag in addition.
10941096

10951097

1098+
.. _whatsnew311-optimizations:
1099+
10961100
Optimizations
10971101
=============
10981102

@@ -1144,6 +1148,8 @@ This section covers specific optimizations independent of the
11441148
(Contributed by Dong-hee Na in :issue:`44987`.)
11451149

11461150

1151+
.. _whatsnew311-faster-cpython:
1152+
11471153
Faster CPython
11481154
==============
11491155

@@ -1156,11 +1162,16 @@ could be up to 10-60% faster.
11561162
This project focuses on two major areas in Python: faster startup and faster
11571163
runtime. Other optimizations not under this project are listed in `Optimizations`_.
11581164

1165+
1166+
.. _whatsnew311-faster-startup:
1167+
11591168
Faster Startup
11601169
--------------
11611170

1171+
.. _whatsnew311-faster-imports:
1172+
11621173
Frozen imports / Static code objects
1163-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1174+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11641175

11651176
Python caches bytecode in the :ref:`__pycache__<tut-pycache>` directory to
11661177
speed up module loading.
@@ -1185,11 +1196,16 @@ impact for short-running programs using Python.
11851196
(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in numerous issues.)
11861197

11871198

1199+
.. _whatsnew311-faster-runtime:
1200+
11881201
Faster Runtime
11891202
--------------
11901203

1204+
.. _whatsnew311-lazy-python-frames:
1205+
11911206
Cheaper, lazy Python frames
1192-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
1207+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
1208+
11931209
Python frames are created whenever Python calls a Python function. This frame
11941210
holds execution information. The following are new frame optimizations:
11951211

@@ -1206,10 +1222,13 @@ up significantly. We measured a 3-7% speedup in pyperformance.
12061222

12071223
(Contributed by Mark Shannon in :issue:`44590`.)
12081224

1225+
12091226
.. _inline-calls:
1227+
.. _whatsnew311-inline-calls:
12101228

12111229
Inlined Python function calls
1212-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1230+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1231+
12131232
During a Python function call, Python will call an evaluating C function to
12141233
interpret that function's code. This effectively limits pure Python recursion to
12151234
what's safe for the C stack.
@@ -1226,8 +1245,12 @@ We measured a 1-3% improvement in pyperformance.
12261245

12271246
(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)
12281247

1248+
1249+
.. _whatsnew311-pep659:
1250+
12291251
PEP 659: Specializing Adaptive Interpreter
1230-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1252+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1253+
12311254
:pep:`659` is one of the key parts of the faster CPython project. The general
12321255
idea is that while Python is a dynamic language, most code has regions where
12331256
objects and types rarely change. This concept is known as *type stability*.
@@ -1309,6 +1332,8 @@ Bucher, with additional help from Irit Katriel and Dennis Sweeney.)
13091332
be sped up by :issue:`45947`.
13101333
13111334
1335+
.. _whatsnew311-faster-cpython-misc:
1336+
13121337
Misc
13131338
----
13141339

@@ -1320,6 +1345,9 @@ Misc
13201345
time required for catching an exception by about 10%.
13211346
(Contributed by Irit Katriel in :issue:`45711`.)
13221347

1348+
1349+
.. _whatsnew311-faster-cpython-faq:
1350+
13231351
FAQ
13241352
---
13251353

@@ -1354,6 +1382,8 @@ FAQ
13541382
| A: No. We're still exploring other optimizations.
13551383
13561384

1385+
.. _whatsnew311-faster-cpython-about:
1386+
13571387
About
13581388
-----
13591389

@@ -1363,6 +1393,8 @@ funded by Bloomberg LP to work on the project part-time. Finally, many
13631393
contributors are volunteers from the community.
13641394

13651395

1396+
.. _whatsnew311-bytecode-changes:
1397+
13661398
CPython bytecode changes
13671399
========================
13681400

@@ -1419,9 +1451,17 @@ CPython bytecode changes
14191451
* :opcode:`RESUME` has been added. It is a no-op. Performs internal tracing,
14201452
debugging and optimization checks.
14211453

1454+
1455+
.. _whatsnew311-deprecated:
1456+
.. _whatsnew311-python-api-deprecated:
1457+
14221458
Deprecated
14231459
==========
14241460

1461+
This section lists Python APIs that have been deprecated in Python 3.11.
1462+
1463+
Deprecated C APIs are :ref:`listed separately <whatsnew311-c-api-deprecated>`.
1464+
14251465
* Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`)
14261466
is now deprecated. It can no longer be used to wrap other descriptors
14271467
such as :class:`property`. The core design of this feature was flawed
@@ -1561,13 +1601,17 @@ Deprecated
15611601
(Contributed by Serhiy Storchaka and Miro Hrončok in :gh:`92728`.)
15621602

15631603

1604+
.. _whatsnew311-pending-removal:
1605+
.. _whatsnew311-python-api-pending-removal:
1606+
15641607
Pending Removal in Python 3.12
15651608
==============================
15661609

1567-
The following APIs have been deprecated in earlier Python releases,
1610+
The following Python APIs have been deprecated in earlier Python releases,
15681611
and will be removed in Python 3.12.
15691612

1570-
Python API:
1613+
C APIs pending removal are
1614+
:ref:`listed separately <whatsnew311-c-api-pending-removal>`.
15711615

15721616
* :class:`pkgutil.ImpImporter`
15731617
* :class:`pkgutil.ImpLoader`
@@ -1596,29 +1640,17 @@ Python API:
15961640
* :func:`sqlite3.OptimizedUnicode`
15971641
* :func:`sqlite3.enable_shared_cache`
15981642

1599-
C API:
1600-
1601-
* :c:func:`PyUnicode_AS_DATA`
1602-
* :c:func:`PyUnicode_AS_UNICODE`
1603-
* :c:func:`PyUnicode_AsUnicodeAndSize`
1604-
* :c:func:`PyUnicode_AsUnicode`
1605-
* :c:func:`PyUnicode_FromUnicode`
1606-
* :c:func:`PyUnicode_GET_DATA_SIZE`
1607-
* :c:func:`PyUnicode_GET_SIZE`
1608-
* :c:func:`PyUnicode_GetSize`
1609-
* :c:func:`PyUnicode_IS_COMPACT`
1610-
* :c:func:`PyUnicode_IS_READY`
1611-
* :c:func:`PyUnicode_READY`
1612-
* :c:func:`Py_UNICODE_WSTR_LENGTH`
1613-
* :c:func:`_PyUnicode_AsUnicode`
1614-
* :c:macro:`PyUnicode_WCHAR_KIND`
1615-
* :c:type:`PyUnicodeObject`
1616-
* :c:func:`PyUnicode_InternImmortal()`
16171643

1644+
.. _whatsnew311-removed:
1645+
.. _whatsnew311-python-api-removed:
16181646

16191647
Removed
16201648
=======
16211649

1650+
This section lists Python APIs that have been removed in Python 3.12.
1651+
1652+
Removed C APIs are :ref:`listed separately <whatsnew311-c-api-removed>`.
1653+
16221654
* :class:`smtpd.MailmanProxy` is now removed as it is unusable without
16231655
an external module, ``mailman``. (Contributed by Dong-hee Na in :issue:`35800`.)
16241656

@@ -1711,15 +1743,18 @@ Removed
17111743
of ``Tools/scripts`` and is `being developed independently
17121744
<https://gitlab.com/warsaw/pynche/-/tree/main>`_ from the Python source tree.
17131745

1746+
1747+
.. _whatsnew311-porting:
1748+
.. _whatsnew311-python-api-porting:
1749+
17141750
Porting to Python 3.11
17151751
======================
17161752

17171753
This section lists previously described changes and other bugfixes
1718-
that may require changes to your code.
1754+
in the Python API that may require changes to your Python code.
17191755

1720-
1721-
Changes in the Python API
1722-
-------------------------
1756+
Porting notes for the C API are
1757+
:ref:`listed separately <whatsnew311-c-api-porting>`.
17231758

17241759
* Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor`
17251760
executors to :meth:`loop.set_default_executor` following a deprecation in
@@ -1768,6 +1803,9 @@ Changes in the Python API
17681803
as meaningless when read. To get the pointer to the object's dictionary call
17691804
:c:func:`PyObject_GenericGetDict` instead.
17701805

1806+
1807+
.. _whatsnew311-build-changes:
1808+
17711809
Build Changes
17721810
=============
17731811

@@ -1855,9 +1893,13 @@ Build Changes
18551893
(Contributed by Serhiy Storchaka in :issue:`46996`.)
18561894

18571895

1896+
.. _whatsnew311-c-api:
1897+
18581898
C API Changes
18591899
=============
18601900

1901+
.. _whatsnew311-c-api-new-features:
1902+
18611903
New Features
18621904
------------
18631905

@@ -1921,6 +1963,9 @@ New Features
19211963
* Added the :c:member:`PyConfig.safe_path` member.
19221964
(Contributed by Victor Stinner in :gh:`57684`.)
19231965

1966+
1967+
.. _whatsnew311-c-api-porting:
1968+
19241969
Porting to Python 3.11
19251970
----------------------
19261971

@@ -2220,6 +2265,9 @@ Porting to Python 3.11
22202265
paths and then modify them, finish initialization and use :c:func:`PySys_GetObject`
22212266
to retrieve :data:`sys.path` as a Python list object and modify it directly.
22222267

2268+
2269+
.. _whatsnew311-c-api-deprecated:
2270+
22232271
Deprecated
22242272
----------
22252273

@@ -2245,6 +2293,35 @@ Deprecated
22452293
* Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:func:`PyObject_Hash` instead.
22462294
(Contributed by Inada Naoki in :issue:`46864`.)
22472295

2296+
2297+
.. _whatsnew311-c-api-pending-removal:
2298+
2299+
Pending Removal in Python 3.12
2300+
------------------------------
2301+
2302+
The following C APIs have been deprecated in earlier Python releases,
2303+
and will be removed in Python 3.12.
2304+
2305+
* :c:func:`PyUnicode_AS_DATA`
2306+
* :c:func:`PyUnicode_AS_UNICODE`
2307+
* :c:func:`PyUnicode_AsUnicodeAndSize`
2308+
* :c:func:`PyUnicode_AsUnicode`
2309+
* :c:func:`PyUnicode_FromUnicode`
2310+
* :c:func:`PyUnicode_GET_DATA_SIZE`
2311+
* :c:func:`PyUnicode_GET_SIZE`
2312+
* :c:func:`PyUnicode_GetSize`
2313+
* :c:func:`PyUnicode_IS_COMPACT`
2314+
* :c:func:`PyUnicode_IS_READY`
2315+
* :c:func:`PyUnicode_READY`
2316+
* :c:func:`Py_UNICODE_WSTR_LENGTH`
2317+
* :c:func:`_PyUnicode_AsUnicode`
2318+
* :c:macro:`PyUnicode_WCHAR_KIND`
2319+
* :c:type:`PyUnicodeObject`
2320+
* :c:func:`PyUnicode_InternImmortal()`
2321+
2322+
2323+
.. _whatsnew311-c-api-removed:
2324+
22482325
Removed
22492326
-------
22502327

0 commit comments

Comments
 (0)