672672
673673* Changed :meth: `Enum.__format__() <enum.Enum.__format__> ` (the default for
674674 :func: `format `, :meth: `str.format ` and :term: `f-string `\s ) to always produce
675- the same result as :meth: `Enum.__str__() `: for enums inheriting from
675+ the same result as :meth: `Enum.__str__() <enum.Enum.__str__> `: for enums inheriting from
676676 :class: `~enum.ReprEnum ` it will be the member's value; for all other enums
677677 it will be the enum and member name (e.g. ``Color.RED ``).
678678
@@ -1604,7 +1604,7 @@ raw, adaptive bytecode containing quickened data.
16041604New opcodes
16051605-----------
16061606
1607- * :opcode: `ASYNC_GEN_WRAP `, :opcode: `RETURN_GENERATOR ` and :opcode: `SEND `,
1607+ * :opcode: `! ASYNC_GEN_WRAP `, :opcode: `RETURN_GENERATOR ` and :opcode: `SEND `,
16081608 used in generators and co-routines.
16091609
16101610* :opcode: `COPY_FREE_VARS `,
@@ -1615,7 +1615,7 @@ New opcodes
16151615
16161616* :opcode: `MAKE_CELL `, to create :ref: `cell-objects `.
16171617
1618- * :opcode: `CHECK_EG_MATCH ` and :opcode: `PREP_RERAISE_STAR `,
1618+ * :opcode: `CHECK_EG_MATCH ` and :opcode: `! PREP_RERAISE_STAR `,
16191619 to handle the :ref: `new exception groups and except* <whatsnew311-pep654 >`
16201620 added in :pep: `654 `.
16211621
@@ -1630,38 +1630,38 @@ New opcodes
16301630Replaced opcodes
16311631----------------
16321632
1633- +------------------------------------+-----------------------------------+-----------------------------------------+
1634- | Replaced Opcode(s) | New Opcode(s) | Notes |
1635- +====================================+===================================+=========================================+
1636- | | :opcode: `!BINARY_* ` | :opcode: `BINARY_OP ` | Replaced all numeric binary/in-place |
1637- | | :opcode: `!INPLACE_* ` | | opcodes with a single opcode |
1638- +------------------------------------+-----------------------------------+-----------------------------------------+
1639- | | :opcode: `!CALL_FUNCTION ` | | :opcode: `CALL ` | Decouples argument shifting for methods |
1640- | | :opcode: `!CALL_FUNCTION_KW ` | | :opcode: `KW_NAMES ` | from handling of keyword arguments; |
1641- | | :opcode: `!CALL_METHOD ` | | :opcode: `PRECALL ` | allows better specialization of calls |
1642- | | | :opcode: `PUSH_NULL ` | |
1643- +------------------------------------+-----------------------------------+-----------------------------------------+
1644- | | :opcode: `!DUP_TOP ` | | :opcode: `COPY ` | Stack manipulation instructions |
1645- | | :opcode: `!DUP_TOP_TWO ` | | :opcode: `SWAP ` | |
1646- | | :opcode: `!ROT_TWO ` | | |
1647- | | :opcode: `!ROT_THREE ` | | |
1648- | | :opcode: `!ROT_FOUR ` | | |
1649- | | :opcode: `!ROT_N ` | | |
1650- +------------------------------------+-----------------------------------+-----------------------------------------+
1651- | | :opcode: `!JUMP_IF_NOT_EXC_MATCH ` | | :opcode: `CHECK_EXC_MATCH ` | Now performs check but doesn't jump |
1652- +------------------------------------+-----------------------------------+-----------------------------------------+
1653- | | :opcode: `!JUMP_ABSOLUTE ` | | :opcode: `JUMP_BACKWARD ` | See [#bytecode-jump ]_; |
1654- | | :opcode: `!POP_JUMP_IF_FALSE ` | | :opcode: `POP_JUMP_BACKWARD_IF_* | ``TRUE ``, ``FALSE ``, |
1655- | | :opcode: `!POP_JUMP_IF_TRUE ` | <POP_JUMP_BACKWARD_IF_TRUE>` | ``NONE `` and ``NOT_NONE `` variants |
1656- | | | :opcode: ` POP_JUMP_FORWARD_IF_* | for each direction |
1657- | | <POP_JUMP_FORWARD_IF_TRUE>` | |
1658- +------------------------------------+-----------------------------------+-----------------------------------------+
1659- | | :opcode: `!SETUP_WITH ` | :opcode: `BEFORE_WITH ` | :keyword: `with ` block setup |
1660- | | :opcode: `!SETUP_ASYNC_WITH ` | | |
1661- +------------------------------------+-----------------------------------+-----------------------------------------+
1633+ +------------------------------------+------------------------------------ +-----------------------------------------+
1634+ | Replaced Opcode(s) | New Opcode(s) | Notes |
1635+ +====================================+==================================== +=========================================+
1636+ | | :opcode: `!BINARY_* ` | :opcode: `BINARY_OP ` | Replaced all numeric binary/in-place |
1637+ | | :opcode: `!INPLACE_* ` | | opcodes with a single opcode |
1638+ +------------------------------------+------------------------------------ +-----------------------------------------+
1639+ | | :opcode: `!CALL_FUNCTION ` | | :opcode: `CALL ` | Decouples argument shifting for methods |
1640+ | | :opcode: `!CALL_FUNCTION_KW ` | | :opcode: `! KW_NAMES ` | from handling of keyword arguments; |
1641+ | | :opcode: `!CALL_METHOD ` | | :opcode: `! PRECALL ` | allows better specialization of calls |
1642+ | | | :opcode: `PUSH_NULL ` | |
1643+ +------------------------------------+------------------------------------ +-----------------------------------------+
1644+ | | :opcode: `!DUP_TOP ` | | :opcode: `COPY ` | Stack manipulation instructions |
1645+ | | :opcode: `!DUP_TOP_TWO ` | | :opcode: `SWAP ` | |
1646+ | | :opcode: `!ROT_TWO ` | | |
1647+ | | :opcode: `!ROT_THREE ` | | |
1648+ | | :opcode: `!ROT_FOUR ` | | |
1649+ | | :opcode: `!ROT_N ` | | |
1650+ +------------------------------------+------------------------------------ +-----------------------------------------+
1651+ | | :opcode: `!JUMP_IF_NOT_EXC_MATCH ` | | :opcode: `CHECK_EXC_MATCH ` | Now performs check but doesn't jump |
1652+ +------------------------------------+------------------------------------ +-----------------------------------------+
1653+ | | :opcode: `!JUMP_ABSOLUTE ` | | :opcode: `JUMP_BACKWARD ` | See [#bytecode-jump ]_; |
1654+ | | :opcode: `!POP_JUMP_IF_FALSE ` | | :opcode: `! POP_JUMP_BACKWARD_IF_*` | ``TRUE` `, ``FALSE ``, |
1655+ | | :opcode: `!POP_JUMP_IF_TRUE ` | | :opcode: ` !POP_JUMP_FORWARD_IF_* ` | ``NONE `` and ``NOT_NONE `` variants |
1656+ | | | for each direction |
1657+ | | | |
1658+ +------------------------------------+------------------------------------ +-----------------------------------------+
1659+ | | :opcode: `!SETUP_WITH ` | :opcode: `BEFORE_WITH ` | :keyword: `with ` block setup |
1660+ | | :opcode: `!SETUP_ASYNC_WITH ` | | |
1661+ +------------------------------------+------------------------------------ +-----------------------------------------+
16621662
16631663.. [#bytecode-jump ] All jump opcodes are now relative, including the
1664- existing :opcode: `JUMP_IF_TRUE_OR_POP ` and :opcode: `JUMP_IF_FALSE_OR_POP `.
1664+ existing :opcode: `! JUMP_IF_TRUE_OR_POP ` and :opcode: `! JUMP_IF_FALSE_OR_POP `.
16651665 The argument is now an offset from the current instruction
16661666 rather than an absolute location.
16671667
@@ -1789,21 +1789,21 @@ Standard Library
17891789 and will be removed in a future Python version,
17901790 due to not supporting resources located within package subdirectories:
17911791
1792- * :func: `importlib.resources.contents `
1793- * :func: `importlib.resources.is_resource `
1794- * :func: `importlib.resources.open_binary `
1795- * :func: `importlib.resources.open_text `
1796- * :func: `importlib.resources.read_binary `
1797- * :func: `importlib.resources.read_text `
1798- * :func: `importlib.resources.path `
1792+ * :func: `! importlib.resources.contents `
1793+ * :func: `! importlib.resources.is_resource `
1794+ * :func: `! importlib.resources.open_binary `
1795+ * :func: `! importlib.resources.open_text `
1796+ * :func: `! importlib.resources.read_binary `
1797+ * :func: `! importlib.resources.read_text `
1798+ * :func: `! importlib.resources.path `
17991799
18001800* The :func: `locale.getdefaultlocale ` function is deprecated and will be
18011801 removed in Python 3.15. Use :func: `locale.setlocale `,
18021802 :func: `locale.getpreferredencoding(False) <locale.getpreferredencoding> ` and
18031803 :func: `locale.getlocale ` functions instead.
18041804 (Contributed by Victor Stinner in :gh: `90817 `.)
18051805
1806- * The :func: `locale.resetlocale ` function is deprecated and will be
1806+ * The :func: `! locale.resetlocale ` function is deprecated and will be
18071807 removed in Python 3.13. Use ``locale.setlocale(locale.LC_ALL, "") `` instead.
18081808 (Contributed by Victor Stinner in :gh: `90817 `.)
18091809
@@ -1967,7 +1967,7 @@ Removed C APIs are :ref:`listed separately <whatsnew311-c-api-removed>`.
19671967
19681968 (Contributed by Victor Stinner in :issue: `45085 `.)
19691969
1970- * Removed the :mod: `distutils ` ``bdist_msi `` command deprecated in Python 3.9.
1970+ * Removed the :mod: `! distutils ` ``bdist_msi `` command deprecated in Python 3.9.
19711971 Use ``bdist_wheel `` (wheel packages) instead.
19721972 (Contributed by Hugo van Kemenade in :issue: `45124 `.)
19731973
@@ -2295,7 +2295,7 @@ Porting to Python 3.11
22952295 as its second parameter, instead of ``PyFrameObject* ``.
22962296 See :pep: `523 ` for more details of how to use this function pointer type.
22972297
2298- * :c:func: `PyCode_New ` and :c:func: `PyCode_NewWithPosOnlyArgs ` now take
2298+ * :c:func: `! PyCode_New ` and :c:func: `! PyCode_NewWithPosOnlyArgs ` now take
22992299 an additional ``exception_table `` argument.
23002300 Using these functions should be avoided, if at all possible.
23012301 To get a custom code object: create a code object using the compiler,
@@ -2402,7 +2402,7 @@ Porting to Python 3.11
24022402 been included directly, consider including ``Python.h `` instead.
24032403 (Contributed by Victor Stinner in :issue: `35134 `.)
24042404
2405- * The :c:func: `PyUnicode_CHECK_INTERNED ` macro has been excluded from the
2405+ * The :c:func: `! PyUnicode_CHECK_INTERNED ` macro has been excluded from the
24062406 limited C API. It was never usable there, because it used internal structures
24072407 which are not available in the limited C API.
24082408 (Contributed by Victor Stinner in :issue: `46007 `.)
@@ -2465,7 +2465,7 @@ Porting to Python 3.11
24652465
24662466 Debuggers that accessed the :attr: `~frame.f_locals ` directly *must * call
24672467 :c:func: `PyFrame_GetLocals ` instead. They no longer need to call
2468- :c:func: `PyFrame_FastToLocalsWithError ` or :c:func: `PyFrame_LocalsToFast `,
2468+ :c:func: `! PyFrame_FastToLocalsWithError ` or :c:func: `! PyFrame_LocalsToFast `,
24692469 in fact they should not call those functions. The necessary updating of the
24702470 frame is now managed by the virtual machine.
24712471
@@ -2604,8 +2604,8 @@ and will be removed in Python 3.12.
26042604* :c:func: `!PyUnicode_GET_DATA_SIZE `
26052605* :c:func: `!PyUnicode_GET_SIZE `
26062606* :c:func: `!PyUnicode_GetSize `
2607- * :c:func: `PyUnicode_IS_COMPACT `
2608- * :c:func: `PyUnicode_IS_READY `
2607+ * :c:func: `! PyUnicode_IS_COMPACT `
2608+ * :c:func: `! PyUnicode_IS_READY `
26092609* :c:func: `PyUnicode_READY `
26102610* :c:func: `!PyUnicode_WSTR_LENGTH `
26112611* :c:func: `!_PyUnicode_AsUnicode `
@@ -2660,7 +2660,7 @@ Removed
26602660 (Contributed by Victor Stinner in :issue: `45474 `.)
26612661
26622662* Exclude :c:func: `PyWeakref_GET_OBJECT ` from the limited C API. It never
2663- worked since the :c:type: `PyWeakReference ` structure is opaque in the
2663+ worked since the :c:type: `! PyWeakReference ` structure is opaque in the
26642664 limited C API.
26652665 (Contributed by Victor Stinner in :issue: `35134 `.)
26662666
0 commit comments