@@ -2794,15 +2794,87 @@ Deprecated
2794
2794
2795
2795
.. include :: ../deprecations/pending-removal-in-3.19.rst
2796
2796
2797
+ .. include :: ../deprecations/pending-removal-in-3.20.rst
2798
+
2797
2799
.. include :: ../deprecations/pending-removal-in-future.rst
2798
2800
2799
2801
2800
2802
CPython bytecode changes
2801
2803
========================
2802
2804
2803
- * Replaced the opcode ``BINARY_SUBSCR `` by :opcode: `BINARY_OP ` with oparg ``NB_SUBSCR ``.
2805
+ * Replaced the opcode :opcode: `!BINARY_SUBSCR ` by the :opcode: `BINARY_OP `
2806
+ opcode with the ``NB_SUBSCR `` oparg.
2807
+ (Contributed by Irit Katriel in :gh: `100239 `.)
2808
+
2809
+ * Add the :opcode: `BUILD_INTERPOLATION ` and :opcode: `BUILD_TEMPLATE `
2810
+ opcodes to construct new :class: `~string.templatelib.Interpolation `
2811
+ and :class: `~string.templatelib.Template ` instances, respectively.
2812
+ (Contributed by Lysandros Nikolaou and others in :gh: `132661 `;
2813
+ see also :ref: `PEP 750: Template strings <whatsnew314-pep750 >`).
2814
+
2815
+ * Remove the :opcode: `!BUILD_CONST_KEY_MAP ` opcode.
2816
+ Use :opcode: `BUILD_MAP ` instead.
2817
+ (Contributed by Mark Shannon in :gh: `122160 `.)
2818
+
2819
+ * Replace the :opcode: `!LOAD_ASSERTION_ERROR ` opcode with
2820
+ :opcode: `LOAD_COMMON_CONSTANT ` and add support for loading
2821
+ :exc: `NotImplementedError `.
2822
+
2823
+ * Add the :opcode: `LOAD_FAST_BORROW ` and :opcode: `LOAD_FAST_BORROW_LOAD_FAST_BORROW `
2824
+ opcodes to reduce reference counting overhead when the interpreter can prove
2825
+ that the reference in the frame outlives the reference loaded onto the stack.
2826
+ (Contributed by Matt Page in :gh: `130704 `.)
2827
+
2828
+ * Add the :opcode: `LOAD_SMALL_INT ` opcode, which pushes a small integer
2829
+ equal to the ``oparg `` to the stack.
2830
+ The :opcode: `!RETURN_CONST ` opcode is removed as it is no longer used.
2831
+ (Contributed by Mark Shannon in :gh: `125837 `.)
2832
+
2833
+ * Add the new :opcode: `LOAD_SPECIAL ` instruction.
2834
+ Generate code for :keyword: `with ` and :keyword: `async with ` statements
2835
+ using the new instruction.
2836
+ Removed the :opcode: `!BEFORE_WITH ` and :opcode: `!BEFORE_ASYNC_WITH ` instructions.
2837
+ (Contributed by Mark Shannon in :gh: `120507 `.)
2838
+
2839
+ * Add the :opcode: `POP_ITER ` opcode to support 'virtual' iterators.
2840
+ (Contributed by Mark Shannon in :gh: `132554 `.)
2841
+
2842
+ Pseudo-instructions
2843
+ -------------------
2844
+
2845
+ * Add the :opcode: `!ANNOTATIONS_PLACEHOLDER ` pseudo instruction
2846
+ to support partially executed module-level annotations with
2847
+ :ref: `deferred evaluation of annotations <whatsnew314-pep649 >`.
2848
+ (Contributed by Jelle Zijlstra in :gh: `130907 `.)
2849
+
2850
+ * Add the :opcode: `!BINARY_OP_EXTEND ` pseudo instruction,
2851
+ which executes a pair of functions (guard and specialization functions)
2852
+ accessed from the inline cache.
2804
2853
(Contributed by Irit Katriel in :gh: `100239 `.)
2805
2854
2855
+ * Add three specializations for :opcode: `CALL_KW `;
2856
+ :opcode: `!CALL_KW_PY ` for calls to Python functions,
2857
+ :opcode: `!CALL_KW_BOUND_METHOD ` for calls to bound methods, and
2858
+ :opcode: `!CALL_KW_NON_PY ` for all other calls.
2859
+ (Contributed by Mark Shannon in :gh: `118093 `.)
2860
+
2861
+ * Add the :opcode: `JUMP_IF_TRUE ` and :opcode: `JUMP_IF_FALSE ` pseudo instructions,
2862
+ conditional jumps which do not impact the stack.
2863
+ Replaced by the sequence ``COPY 1 ``, ``TO_BOOL ``, ``POP_JUMP_IF_TRUE/FALSE ``.
2864
+ (Contributed by Irit Katriel in :gh: `124285 `.)
2865
+
2866
+ * Add the :opcode: `!LOAD_CONST_MORTAL ` pseudo instruction.
2867
+ (Contributed by Mark Shannon in :gh: `128685 `.)
2868
+
2869
+ * Add the :opcode: `!LOAD_CONST_IMMORTAL ` pseudo instruction,
2870
+ which does the same as :opcode: `!LOAD_CONST `, but is more efficient
2871
+ for immortal objects.
2872
+ (Contributed by Mark Shannon in :gh: `125837 `.)
2873
+
2874
+ * Add the :opcode: `NOT_TAKEN ` pseudo instruction, used by :mod: `sys.monitoring `
2875
+ to record branch events (such as :monitoring-event: `BRANCH_LEFT `).
2876
+ (Contributed by Mark Shannon in :gh: `122548 `.)
2877
+
2806
2878
2807
2879
C API changes
2808
2880
=============
0 commit comments