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 @@ -1752,6 +1752,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 @@ -290,6 +290,7 @@ Known values:
Python 3.15a4 3657 (Add BINARY_OP_SUBSCR_USTR_INT)
Python 3.15a4 3658 (Optimize bytecode for list/set called on genexp)
Python 3.15a4 3659 (Add CALL_FUNCTION_EX specialization)
Python 3.15a4 3660 (Add MATCH_CLASS_ISINSTANCE & MATCH_CLASS_GET_OPT_ATTR)


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

*/

#define PYC_MAGIC_NUMBER 3659
#define PYC_MAGIC_NUMBER 3660
/* 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.

Loading
Loading