Skip to content
Closed
7 changes: 7 additions & 0 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,13 @@ iterations of the loop.
Previously, this instruction also pushed a boolean value indicating
success (``True``) or failure (``False``).

.. opcode:: CHECK_PERIODIC

Detects and handles certain conditions of interpreter state, such as
signals and async exceptions. This bytecode is emitted alongside calls
and backward jumps to ensure that it appears in any long execution path.

.. versionadded:: 3.14

.. opcode:: RESUME (context)

Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1696,6 +1696,9 @@ CPython Bytecode Changes
* Replaced the opcode ``BINARY_SUBSCR`` by :opcode:`BINARY_OP` with oparg ``NB_SUBSCR``.
(Contributed by Irit Katriel in :gh:`100239`.)

* Added opcode ``CHECK_PERIODIC`` which detects and handles signals, async exceptions,
etc. (Contributed by Irit Katriel in :gh:`132532`.)

Porting to Python 3.14
======================

Expand Down
3 changes: 2 additions & 1 deletion Include/internal/pycore_magic_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ Known values:
Python 3.14a6 3620 (Optimize bytecode for all/any/tuple called on a genexp)
Python 3.14a7 3621 (Optimize LOAD_FAST opcodes into LOAD_FAST_BORROW)
Python 3.14a7 3622 (Store annotations in different class dict keys)
Python 3.14a7 3623 (Add CHECK_PERIODIC instruction)

Python 3.15 will start with 3650

Expand All @@ -287,7 +288,7 @@ PC/launcher.c must also be updated.

*/

#define PYC_MAGIC_NUMBER 3622
#define PYC_MAGIC_NUMBER 3623
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
(little-endian) and then appending b'\r\n'. */
#define PYC_MAGIC_NUMBER_TOKEN \
Expand Down
65 changes: 36 additions & 29 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading