Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,25 @@ iterations of the loop.
.. versionadded:: 3.13


.. opcode:: MATCH_CLASS_ISINSTANCE

Read match subject ``Stack[-2]`` and the type object ``Stack[-1]`` from stack.
Pop ``Stack[-1]`` and push ``True`` or ``False`` for the result of :func:`isinstance`.

.. versionadded:: 3.15


.. opcode:: MATCH_CLASS_GET_OPT_ATTR (namei)

Replaces ``STACK[-1]`` with ``getattr(STACK[-1], co_names[namei])`` and get
optional attribute from match subject ``STACK[-2]``.

Pop ``Stack[-1]``. If attribute is found, push it and ``True`` onto the stack.
Otherwise push ``None`` and ``False``.

.. versionadded:: 3.15


.. opcode:: MATCH_CLASS (count)

``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the class
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 @@ -286,6 +286,7 @@ Known values:
Python 3.15a1 3653 (Fix handling of opcodes that may leave operands on the stack when optimizing LOAD_FAST)
Python 3.15a1 3654 (Fix missing exception handlers in logical expression)
Python 3.15a1 3655 (Fix miscompilation of some module-level annotations)
Python 3.15a1 3656 (Add MATCH_CLASS_ISINSTANCE & MATCH_CLASS_GET_OPT_ATTR)


Python 3.16 will start with 3700
Expand All @@ -299,7 +300,7 @@ PC/launcher.c must also be updated.

*/

#define PYC_MAGIC_NUMBER 3655
#define PYC_MAGIC_NUMBER 3656
/* 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
20 changes: 16 additions & 4 deletions Include/internal/pycore_opcode_metadata.h

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

2 changes: 2 additions & 0 deletions Include/internal/pycore_uop_ids.h

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

8 changes: 8 additions & 0 deletions Include/internal/pycore_uop_metadata.h

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

198 changes: 100 additions & 98 deletions Include/opcode_ids.h

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

Loading
Loading