672
672
673
673
* Changed :meth: `Enum.__format__() <enum.Enum.__format__> ` (the default for
674
674
: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
676
676
:class: `~enum.ReprEnum ` it will be the member's value; for all other enums
677
677
it will be the enum and member name (e.g. ``Color.RED ``).
678
678
@@ -1604,7 +1604,7 @@ raw, adaptive bytecode containing quickened data.
1604
1604
New opcodes
1605
1605
-----------
1606
1606
1607
- * :opcode: `ASYNC_GEN_WRAP `, :opcode: `RETURN_GENERATOR ` and :opcode: `SEND `,
1607
+ * :opcode: `! ASYNC_GEN_WRAP `, :opcode: `RETURN_GENERATOR ` and :opcode: `SEND `,
1608
1608
used in generators and co-routines.
1609
1609
1610
1610
* :opcode: `COPY_FREE_VARS `,
@@ -1615,7 +1615,7 @@ New opcodes
1615
1615
1616
1616
* :opcode: `MAKE_CELL `, to create :ref: `cell-objects `.
1617
1617
1618
- * :opcode: `CHECK_EG_MATCH ` and :opcode: `PREP_RERAISE_STAR `,
1618
+ * :opcode: `CHECK_EG_MATCH ` and :opcode: `! PREP_RERAISE_STAR `,
1619
1619
to handle the :ref: `new exception groups and except* <whatsnew311-pep654 >`
1620
1620
added in :pep: `654 `.
1621
1621
@@ -1630,38 +1630,38 @@ New opcodes
1630
1630
Replaced opcodes
1631
1631
----------------
1632
1632
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
+ +------------------------------------+------------------------------------ +-----------------------------------------+
1662
1662
1663
1663
.. [#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 `.
1665
1665
The argument is now an offset from the current instruction
1666
1666
rather than an absolute location.
1667
1667
@@ -1967,7 +1967,7 @@ Removed C APIs are :ref:`listed separately <whatsnew311-c-api-removed>`.
1967
1967
1968
1968
(Contributed by Victor Stinner in :issue: `45085 `.)
1969
1969
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.
1971
1971
Use ``bdist_wheel `` (wheel packages) instead.
1972
1972
(Contributed by Hugo van Kemenade in :issue: `45124 `.)
1973
1973
@@ -2295,7 +2295,7 @@ Porting to Python 3.11
2295
2295
as its second parameter, instead of ``PyFrameObject* ``.
2296
2296
See :pep: `523 ` for more details of how to use this function pointer type.
2297
2297
2298
- * :c:func: `PyCode_New ` and :c:func: `PyCode_NewWithPosOnlyArgs ` now take
2298
+ * :c:func: `! PyCode_New ` and :c:func: `! PyCode_NewWithPosOnlyArgs ` now take
2299
2299
an additional ``exception_table `` argument.
2300
2300
Using these functions should be avoided, if at all possible.
2301
2301
To get a custom code object: create a code object using the compiler,
@@ -2402,7 +2402,7 @@ Porting to Python 3.11
2402
2402
been included directly, consider including ``Python.h `` instead.
2403
2403
(Contributed by Victor Stinner in :issue: `35134 `.)
2404
2404
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
2406
2406
limited C API. It was never usable there, because it used internal structures
2407
2407
which are not available in the limited C API.
2408
2408
(Contributed by Victor Stinner in :issue: `46007 `.)
@@ -2465,7 +2465,7 @@ Porting to Python 3.11
2465
2465
2466
2466
Debuggers that accessed the :attr: `~frame.f_locals ` directly *must * call
2467
2467
: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 `,
2469
2469
in fact they should not call those functions. The necessary updating of the
2470
2470
frame is now managed by the virtual machine.
2471
2471
@@ -2604,8 +2604,8 @@ and will be removed in Python 3.12.
2604
2604
* :c:func: `!PyUnicode_GET_DATA_SIZE `
2605
2605
* :c:func: `!PyUnicode_GET_SIZE `
2606
2606
* :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 `
2609
2609
* :c:func: `PyUnicode_READY `
2610
2610
* :c:func: `!PyUnicode_WSTR_LENGTH `
2611
2611
* :c:func: `!_PyUnicode_AsUnicode `
@@ -2660,7 +2660,7 @@ Removed
2660
2660
(Contributed by Victor Stinner in :issue: `45474 `.)
2661
2661
2662
2662
* 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
2664
2664
limited C API.
2665
2665
(Contributed by Victor Stinner in :issue: `35134 `.)
2666
2666
0 commit comments