import type {AssemblyInstructionInfo} from '../../../types/assembly-docs.interfaces.js'; export function getAsmOpcode(opcode: string | undefined): AssemblyInstructionInfo | undefined { if (!opcode) return; switch (opcode.toUpperCase()) { case "BEFORE_ASYNC_WITH": return { "html": "

Resolves __aenter__ and __aexit__ from STACK[-1].\nPushes __aexit__ and result of __aenter__() to the stack:

\n
STACK.extend((__aexit__, __aenter__())\n
\n\n\n

Added in version 3.5.

\n\n", "tooltip": "Resolves __aenter__ and __aexit__ from STACK[-1].\nPushes __aexit__ and result of __aenter__() to the stack", "url": "https://docs.python.org/3/library/dis.html#opcode-BEFORE_ASYNC_WITH" }; case "BEFORE_WITH": return { "html": "

This opcode performs several operations before a with block starts. First,\nit loads __exit__() from the context manager and pushes it onto\nthe stack for later use by WITH_EXCEPT_START. Then,\n__enter__() is called. Finally, the result of calling the\n__enter__() method is pushed onto the stack.

\n\n

Added in version 3.11.

\n\n", "tooltip": "This opcode performs several operations before a with block starts. First,\nit loads __exit__() from the context manager and pushes it onto\nthe stack for later use by WITH_EXCEPT_START. Then,\n__enter__() is called. Finally, the result of calling the\n__enter__() method is pushed onto the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-BEFORE_WITH" }; case "BINARY_OP": return { "html": "

Implements the binary and in-place operators (depending on the value of\nop):

\n
rhs = STACK.pop()\nlhs = STACK.pop()\nSTACK.append(lhs op rhs)\n
\n\n\n

Added in version 3.11.

\n\n", "tooltip": "Implements the binary and in-place operators (depending on the value of\nop)", "url": "https://docs.python.org/3/library/dis.html#opcode-BINARY_OP" }; case "BINARY_SLICE": return { "html": "

Implements:

\n
end = STACK.pop()\nstart = STACK.pop()\ncontainer = STACK.pop()\nSTACK.append(container[start:end])\n
\n\n\n

Added in version 3.12.

\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-BINARY_SLICE" }; case "BINARY_SUBSCR": return { "html": "

Implements:

\n
key = STACK.pop()\ncontainer = STACK.pop()\nSTACK.append(container[key])\n
\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-BINARY_SUBSCR" }; case "BUILD_CONST_KEY_MAP": return { "html": "

The version of BUILD_MAP specialized for constant keys. Pops the\ntop element on the stack which contains a tuple of keys, then starting from\nSTACK[-2], pops count values to form values in the built dictionary.

\n\n

Added in version 3.6.

\n\n", "tooltip": "The version of BUILD_MAP specialized for constant keys. Pops the\ntop element on the stack which contains a tuple of keys, then starting from\nSTACK[-2], pops count values to form values in the built dictionary.", "url": "https://docs.python.org/3/library/dis.html#opcode-BUILD_CONST_KEY_MAP" }; case "BUILD_LIST": return { "html": "

Works as BUILD_TUPLE, but creates a list.

\n", "tooltip": "Works as BUILD_TUPLE, but creates a list.", "url": "https://docs.python.org/3/library/dis.html#opcode-BUILD_LIST" }; case "BUILD_MAP": return { "html": "

Pushes a new dictionary object onto the stack. Pops 2 * count items\nso that the dictionary holds count entries:\n{..., STACK[-4]: STACK[-3], STACK[-2]: STACK[-1]}.

\n\n

Changed in version 3.5: The dictionary is created from stack items instead of creating an\nempty dictionary pre-sized to hold count items.

\n\n", "tooltip": "Pushes a new dictionary object onto the stack. Pops 2 * count items\nso that the dictionary holds count entries:\n{..., STACK[-4]: STACK[-3], STACK[-2]: STACK[-1]}.", "url": "https://docs.python.org/3/library/dis.html#opcode-BUILD_MAP" }; case "BUILD_SET": return { "html": "

Works as BUILD_TUPLE, but creates a set.

\n", "tooltip": "Works as BUILD_TUPLE, but creates a set.", "url": "https://docs.python.org/3/library/dis.html#opcode-BUILD_SET" }; case "BUILD_SLICE": return { "html": "

Pushes a slice object on the stack. argc must be 2 or 3. If it is 2, implements:

\n
end = STACK.pop()\nstart = STACK.pop()\nSTACK.append(slice(start, end))\n
\n\n

if it is 3, implements:

\n
step = STACK.pop()\nend = STACK.pop()\nstart = STACK.pop()\nSTACK.append(slice(start, end, step))\n
\n\n

See the slice() built-in function for more information.

\n", "tooltip": "Pushes a slice object on the stack. argc must be 2 or 3. If it is 2, implements", "url": "https://docs.python.org/3/library/dis.html#opcode-BUILD_SLICE" }; case "BUILD_STRING": return { "html": "

Concatenates count strings from the stack and pushes the resulting string\nonto the stack.

\n\n

Added in version 3.6.

\n\n", "tooltip": "Concatenates count strings from the stack and pushes the resulting string\nonto the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-BUILD_STRING" }; case "BUILD_TUPLE": return { "html": "

Creates a tuple consuming count items from the stack, and pushes the\nresulting tuple onto the stack:

\n
if count == 0:\n    value = ()\nelse:\n    value = tuple(STACK[-count:])\n    STACK = STACK[:-count]\n\nSTACK.append(value)\n
\n\n", "tooltip": "Creates a tuple consuming count items from the stack, and pushes the\nresulting tuple onto the stack", "url": "https://docs.python.org/3/library/dis.html#opcode-BUILD_TUPLE" }; case "CACHE": return { "html": "

Rather than being an actual instruction, this opcode is used to mark extra\nspace for the interpreter to cache useful data directly in the bytecode\nitself. It is automatically hidden by all dis utilities, but can be\nviewed with show_caches=True.

\n

Logically, this space is part of the preceding instruction. Many opcodes\nexpect to be followed by an exact number of caches, and will instruct the\ninterpreter to skip over them at runtime.

\n

Populated caches can look like arbitrary instructions, so great care should\nbe taken when reading or modifying raw, adaptive bytecode containing\nquickened data.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Rather than being an actual instruction, this opcode is used to mark extra\nspace for the interpreter to cache useful data directly in the bytecode\nitself. It is automatically hidden by all dis utilities, but can be\nviewed with show_caches=True.", "url": "https://docs.python.org/3/library/dis.html#opcode-CACHE" }; case "CALL": return { "html": "

Calls a callable object with the number of arguments specified by argc.\nOn the stack are (in ascending order):

\n\n

argc is the total of the positional arguments, excluding self.

\n

CALL pops all arguments and the callable object off the stack,\ncalls the callable object with those arguments, and pushes the return value\nreturned by the callable object.

\n\n

Added in version 3.11.

\n\n\n

Changed in version 3.13: The callable now always appears at the same position on the stack.

\n\n\n

Changed in version 3.13: Calls with keyword arguments are now handled by CALL_KW.

\n\n", "tooltip": "Calls a callable object with the number of arguments specified by argc.\nOn the stack are (in ascending order)", "url": "https://docs.python.org/3/library/dis.html#opcode-CALL" }; case "CALL_FUNCTION_EX": return { "html": "

Calls a callable object with variable set of positional and keyword\narguments. If the lowest bit of flags is set, the top of the stack\ncontains a mapping object containing additional keyword arguments.\nBefore the callable is called, the mapping object and iterable object\nare each \u201cunpacked\u201d and their contents passed in as keyword and\npositional arguments respectively.\nCALL_FUNCTION_EX pops all arguments and the callable object off the stack,\ncalls the callable object with those arguments, and pushes the return value\nreturned by the callable object.

\n\n

Added in version 3.6.

\n\n", "tooltip": "Calls a callable object with variable set of positional and keyword\narguments. If the lowest bit of flags is set, the top of the stack\ncontains a mapping object containing additional keyword arguments.\nBefore the callable is called, the mapping object and iterable object\nare each \u201cunpacked\u201d and their contents passed in as keyword and\npositional arguments respectively.\nCALL_FUNCTION_EX pops all arguments and the callable object off the stack,\ncalls the callable object with those arguments, and pushes the return value\nreturned by the callable object.", "url": "https://docs.python.org/3/library/dis.html#opcode-CALL_FUNCTION_EX" }; case "CALL_INTRINSIC_1": return { "html": "

Calls an intrinsic function with one argument. Passes STACK[-1] as the\nargument and sets STACK[-1] to the result. Used to implement\nfunctionality that is not performance critical.

\n

The operand determines which intrinsic function is called:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n

Operand

Description

INTRINSIC_1_INVALID

Not valid

INTRINSIC_PRINT

Prints the argument to standard\nout. Used in the REPL.

INTRINSIC_IMPORT_STAR

Performs import * for the\nnamed module.

INTRINSIC_STOPITERATION_ERROR

Extracts the return value from a\nStopIteration exception.

INTRINSIC_ASYNC_GEN_WRAP

Wraps an async generator value

INTRINSIC_UNARY_POSITIVE

Performs the unary +\noperation

INTRINSIC_LIST_TO_TUPLE

Converts a list to a tuple

INTRINSIC_TYPEVAR

Creates a typing.TypeVar

INTRINSIC_PARAMSPEC

Creates a\ntyping.ParamSpec

INTRINSIC_TYPEVARTUPLE

Creates a\ntyping.TypeVarTuple

INTRINSIC_SUBSCRIPT_GENERIC

Returns typing.Generic\nsubscripted with the argument

INTRINSIC_TYPEALIAS

Creates a\ntyping.TypeAliasType;\nused in the type\nstatement. The argument is a tuple\nof the type alias\u2019s name,\ntype parameters, and value.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Calls an intrinsic function with one argument. Passes STACK[-1] as the\nargument and sets STACK[-1] to the result. Used to implement\nfunctionality that is not performance critical.", "url": "https://docs.python.org/3/library/dis.html#opcode-CALL_INTRINSIC_1" }; case "CALL_INTRINSIC_2": return { "html": "

Calls an intrinsic function with two arguments. Used to implement functionality\nthat is not performance critical:

\n
arg2 = STACK.pop()\narg1 = STACK.pop()\nresult = intrinsic2(arg1, arg2)\nSTACK.append(result)\n
\n\n

The operand determines which intrinsic function is called:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n

Operand

Description

INTRINSIC_2_INVALID

Not valid

INTRINSIC_PREP_RERAISE_STAR

Calculates the\nExceptionGroup to raise\nfrom a try-except*.

INTRINSIC_TYPEVAR_WITH_BOUND

Creates a typing.TypeVar\nwith a bound.

INTRINSIC_TYPEVAR_WITH_CONSTRAINTS

Creates a\ntyping.TypeVar with\nconstraints.

INTRINSIC_SET_FUNCTION_TYPE_PARAMS

Sets the __type_params__\nattribute of a function.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Calls an intrinsic function with two arguments. Used to implement functionality\nthat is not performance critical", "url": "https://docs.python.org/3/library/dis.html#opcode-CALL_INTRINSIC_2" }; case "CALL_KW": return { "html": "

Calls a callable object with the number of arguments specified by argc,\nincluding one or more named arguments. On the stack are (in ascending order):

\n\n

argc is the total of the positional and named arguments, excluding self.\nThe length of the tuple of keyword argument names is the number of named arguments.

\n

CALL_KW pops all arguments, the keyword names, and the callable object\noff the stack, calls the callable object with those arguments, and pushes the\nreturn value returned by the callable object.

\n\n

Added in version 3.13.

\n\n", "tooltip": "Calls a callable object with the number of arguments specified by argc,\nincluding one or more named arguments. On the stack are (in ascending order)", "url": "https://docs.python.org/3/library/dis.html#opcode-CALL_KW" }; case "CHECK_EG_MATCH": return { "html": "

Performs exception matching for except*. Applies split(STACK[-1]) on\nthe exception group representing STACK[-2].

\n

In case of a match, pops two items from the stack and pushes the\nnon-matching subgroup (None in case of full match) followed by the\nmatching subgroup. When there is no match, pops one item (the match\ntype) and pushes None.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Performs exception matching for except*. Applies split(STACK[-1]) on\nthe exception group representing STACK[-2].", "url": "https://docs.python.org/3/library/dis.html#opcode-CHECK_EG_MATCH" }; case "CHECK_EXC_MATCH": return { "html": "

Performs exception matching for except. Tests whether the STACK[-2]\nis an exception matching STACK[-1]. Pops STACK[-1] and pushes the boolean\nresult of the test.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Performs exception matching for except. Tests whether the STACK[-2]\nis an exception matching STACK[-1]. Pops STACK[-1] and pushes the boolean\nresult of the test.", "url": "https://docs.python.org/3/library/dis.html#opcode-CHECK_EXC_MATCH" }; case "CLEANUP_THROW": return { "html": "

Handles an exception raised during a throw() or\nclose() call through the current frame. If STACK[-1] is an\ninstance of StopIteration, pop three values from the stack and push\nits value member. Otherwise, re-raise STACK[-1].

\n\n

Added in version 3.12.

\n\n", "tooltip": "Handles an exception raised during a throw() or\nclose() call through the current frame. If STACK[-1] is an\ninstance of StopIteration, pop three values from the stack and push\nits value member. Otherwise, re-raise STACK[-1].", "url": "https://docs.python.org/3/library/dis.html#opcode-CLEANUP_THROW" }; case "COMPARE_OP": return { "html": "

Performs a Boolean operation. The operation name can be found in\ncmp_op[opname >> 5]. If the fifth-lowest bit of opname is set\n(opname & 16), the result should be coerced to bool.

\n\n

Changed in version 3.13: The fifth-lowest bit of the oparg now indicates a forced conversion to\nbool.

\n\n", "tooltip": "Performs a Boolean operation. The operation name can be found in\ncmp_op[opname >> 5]. If the fifth-lowest bit of opname is set\n(opname & 16), the result should be coerced to bool.", "url": "https://docs.python.org/3/library/dis.html#opcode-COMPARE_OP" }; case "CONTAINS_OP": return { "html": "

Performs in comparison, or not in if invert is 1.

\n\n

Added in version 3.9.

\n\n", "tooltip": "Performs in comparison, or not in if invert is 1.", "url": "https://docs.python.org/3/library/dis.html#opcode-CONTAINS_OP" }; case "CONVERT_VALUE": return { "html": "

Convert value to a string, depending on oparg:

\n
value = STACK.pop()\nresult = func(value)\nSTACK.append(result)\n
\n\n\n

Used for implementing formatted string literals (f-strings).

\n\n

Added in version 3.13.

\n\n", "tooltip": "Convert value to a string, depending on oparg", "url": "https://docs.python.org/3/library/dis.html#opcode-CONVERT_VALUE" }; case "COPY": return { "html": "

Push the i-th item to the top of the stack without removing it from its original\nlocation:

\n
assert i > 0\nSTACK.append(STACK[-i])\n
\n\n\n

Added in version 3.11.

\n\n", "tooltip": "Push the i-th item to the top of the stack without removing it from its original\nlocation", "url": "https://docs.python.org/3/library/dis.html#opcode-COPY" }; case "COPY_FREE_VARS": return { "html": "

Copies the n free (closure) variables from the closure\ninto the frame. Removes the need for special code on the caller\u2019s side when calling\nclosures.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Copies the n free (closure) variables from the closure\ninto the frame. Removes the need for special code on the caller\u2019s side when calling\nclosures.", "url": "https://docs.python.org/3/library/dis.html#opcode-COPY_FREE_VARS" }; case "DELETE_ATTR": return { "html": "

Implements:

\n
obj = STACK.pop()\ndel obj.name\n
\n\n

where namei is the index of name into co_names of the\ncode object.

\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-DELETE_ATTR" }; case "DELETE_DEREF": return { "html": "

Empties the cell contained in slot i of the \u201cfast locals\u201d storage.\nUsed by the del statement.

\n\n

Added in version 3.2.

\n\n\n

Changed in version 3.11: i is no longer offset by the length of co_varnames.

\n\n", "tooltip": "Empties the cell contained in slot i of the \u201cfast locals\u201d storage.\nUsed by the del statement.", "url": "https://docs.python.org/3/library/dis.html#opcode-DELETE_DEREF" }; case "DELETE_FAST": return { "html": "

Deletes local co_varnames[var_num].

\n", "tooltip": "Deletes local co_varnames[var_num].", "url": "https://docs.python.org/3/library/dis.html#opcode-DELETE_FAST" }; case "DELETE_GLOBAL": return { "html": "

Works as DELETE_NAME, but deletes a global name.

\n", "tooltip": "Works as DELETE_NAME, but deletes a global name.", "url": "https://docs.python.org/3/library/dis.html#opcode-DELETE_GLOBAL" }; case "DELETE_NAME": return { "html": "

Implements del name, where namei is the index into co_names\nattribute of the code object.

\n", "tooltip": "Implements del name, where namei is the index into co_names\nattribute of the code object.", "url": "https://docs.python.org/3/library/dis.html#opcode-DELETE_NAME" }; case "DELETE_SUBSCR": return { "html": "

Implements:

\n
key = STACK.pop()\ncontainer = STACK.pop()\ndel container[key]\n
\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-DELETE_SUBSCR" }; case "DICT_MERGE": return { "html": "

Like DICT_UPDATE but raises an exception for duplicate keys.

\n\n

Added in version 3.9.

\n\n", "tooltip": "Like DICT_UPDATE but raises an exception for duplicate keys.", "url": "https://docs.python.org/3/library/dis.html#opcode-DICT_MERGE" }; case "DICT_UPDATE": return { "html": "

Implements:

\n
map = STACK.pop()\ndict.update(STACK[-i], map)\n
\n\n

Used to build dicts.

\n\n

Added in version 3.9.

\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-DICT_UPDATE" }; case "END_ASYNC_FOR": return { "html": "

Terminates an async for loop. Handles an exception raised\nwhen awaiting a next item. The stack contains the async iterable in\nSTACK[-2] and the raised exception in STACK[-1]. Both are popped.\nIf the exception is not StopAsyncIteration, it is re-raised.

\n\n

Added in version 3.8.

\n\n\n

Changed in version 3.11: Exception representation on the stack now consist of one, not three, items.

\n\n", "tooltip": "Terminates an async for loop. Handles an exception raised\nwhen awaiting a next item. The stack contains the async iterable in\nSTACK[-2] and the raised exception in STACK[-1]. Both are popped.\nIf the exception is not StopAsyncIteration, it is re-raised.", "url": "https://docs.python.org/3/library/dis.html#opcode-END_ASYNC_FOR" }; case "END_FOR": return { "html": "

Removes the top-of-stack item.\nEquivalent to POP_TOP.\nUsed to clean up at the end of loops, hence the name.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Removes the top-of-stack item.\nEquivalent to POP_TOP.\nUsed to clean up at the end of loops, hence the name.", "url": "https://docs.python.org/3/library/dis.html#opcode-END_FOR" }; case "END_SEND": return { "html": "

Implements del STACK[-2].\nUsed to clean up when a generator exits.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Implements del STACK[-2].\nUsed to clean up when a generator exits.", "url": "https://docs.python.org/3/library/dis.html#opcode-END_SEND" }; case "EXTENDED_ARG": return { "html": "

Prefixes any opcode which has an argument too big to fit into the default one\nbyte. ext holds an additional byte which act as higher bits in the argument.\nFor each opcode, at most three prefixal EXTENDED_ARG are allowed, forming\nan argument from two-byte to four-byte.

\n", "tooltip": "Prefixes any opcode which has an argument too big to fit into the default one\nbyte. ext holds an additional byte which act as higher bits in the argument.\nFor each opcode, at most three prefixal EXTENDED_ARG are allowed, forming\nan argument from two-byte to four-byte.", "url": "https://docs.python.org/3/library/dis.html#opcode-EXTENDED_ARG" }; case "FORMAT_SIMPLE": return { "html": "

Formats the value on top of stack:

\n
value = STACK.pop()\nresult = value.__format__(\"\")\nSTACK.append(result)\n
\n\n

Used for implementing formatted string literals (f-strings).

\n\n

Added in version 3.13.

\n\n", "tooltip": "Formats the value on top of stack", "url": "https://docs.python.org/3/library/dis.html#opcode-FORMAT_SIMPLE" }; case "FORMAT_WITH_SPEC": return { "html": "

Formats the given value with the given format spec:

\n
spec = STACK.pop()\nvalue = STACK.pop()\nresult = value.__format__(spec)\nSTACK.append(result)\n
\n\n

Used for implementing formatted string literals (f-strings).

\n\n

Added in version 3.13.

\n\n", "tooltip": "Formats the given value with the given format spec", "url": "https://docs.python.org/3/library/dis.html#opcode-FORMAT_WITH_SPEC" }; case "FOR_ITER": return { "html": "

STACK[-1] is an iterator. Call its __next__() method.\nIf this yields a new value, push it on the stack (leaving the iterator below\nit). If the iterator indicates it is exhausted then the byte code counter is\nincremented by delta.

\n\n

Changed in version 3.12: Up until 3.11 the iterator was popped when it was exhausted.

\n\n", "tooltip": "STACK[-1] is an iterator. Call its __next__() method.\nIf this yields a new value, push it on the stack (leaving the iterator below\nit). If the iterator indicates it is exhausted then the byte code counter is\nincremented by delta.", "url": "https://docs.python.org/3/library/dis.html#opcode-FOR_ITER" }; case "GET_AITER": return { "html": "

Implements STACK[-1] = STACK[-1].__aiter__().

\n\n

Added in version 3.5.

\n\n\n

Changed in version 3.7: Returning awaitable objects from __aiter__ is no longer\nsupported.

\n\n", "tooltip": "Implements STACK[-1] = STACK[-1].__aiter__().", "url": "https://docs.python.org/3/library/dis.html#opcode-GET_AITER" }; case "GET_ANEXT": return { "html": "

Implement STACK.append(get_awaitable(STACK[-1].__anext__())) to the stack.\nSee GET_AWAITABLE for details about get_awaitable.

\n\n

Added in version 3.5.

\n\n", "tooltip": "Implement STACK.append(get_awaitable(STACK[-1].__anext__())) to the stack.\nSee GET_AWAITABLE for details about get_awaitable.", "url": "https://docs.python.org/3/library/dis.html#opcode-GET_ANEXT" }; case "GET_AWAITABLE": return { "html": "

Implements STACK[-1] = get_awaitable(STACK[-1]), where get_awaitable(o)\nreturns o if o is a coroutine object or a generator object with\nthe CO_ITERABLE_COROUTINE flag, or resolves\no.__await__.

\n\n

If the where operand is nonzero, it indicates where the instruction\noccurs:

\n\n\n\n

Added in version 3.5.

\n\n\n

Changed in version 3.11: Previously, this instruction did not have an oparg.

\n\n", "tooltip": "Implements STACK[-1] = get_awaitable(STACK[-1]), where get_awaitable(o)\nreturns o if o is a coroutine object or a generator object with\nthe CO_ITERABLE_COROUTINE flag, or resolves\no.__await__.", "url": "https://docs.python.org/3/library/dis.html#opcode-GET_AWAITABLE" }; case "GET_ITER": return { "html": "

Implements STACK[-1] = iter(STACK[-1]).

\n", "tooltip": "Implements STACK[-1] = iter(STACK[-1]).", "url": "https://docs.python.org/3/library/dis.html#opcode-GET_ITER" }; case "GET_LEN": return { "html": "

Perform STACK.append(len(STACK[-1])). Used in match statements where\ncomparison with structure of pattern is needed.

\n\n

Added in version 3.10.

\n\n", "tooltip": "Perform STACK.append(len(STACK[-1])). Used in match statements where\ncomparison with structure of pattern is needed.", "url": "https://docs.python.org/3/library/dis.html#opcode-GET_LEN" }; case "GET_YIELD_FROM_ITER": return { "html": "

If STACK[-1] is a generator iterator or coroutine object\nit is left as is. Otherwise, implements STACK[-1] = iter(STACK[-1]).

\n\n

Added in version 3.5.

\n\n", "tooltip": "If STACK[-1] is a generator iterator or coroutine object\nit is left as is. Otherwise, implements STACK[-1] = iter(STACK[-1]).", "url": "https://docs.python.org/3/library/dis.html#opcode-GET_YIELD_FROM_ITER" }; case "HAVE_ARGUMENT": return { "html": "

This is not really an opcode. It identifies the dividing line between\nopcodes in the range [0,255] which don\u2019t use their argument and those\nthat do (< HAVE_ARGUMENT and >= HAVE_ARGUMENT, respectively).

\n

If your application uses pseudo instructions or specialized instructions,\nuse the hasarg collection instead.

\n\n

Changed in version 3.6: Now every instruction has an argument, but opcodes < HAVE_ARGUMENT\nignore it. Before, only opcodes >= HAVE_ARGUMENT had an argument.

\n\n\n

Changed in version 3.12: Pseudo instructions were added to the dis module, and for them\nit is not true that comparison with HAVE_ARGUMENT indicates whether\nthey use their arg.

\n\n\n

Deprecated since version 3.13: Use hasarg instead.

\n\n", "tooltip": "This is not really an opcode. It identifies the dividing line between\nopcodes in the range [0,255] which don\u2019t use their argument and those\nthat do (< HAVE_ARGUMENT and >= HAVE_ARGUMENT, respectively).", "url": "https://docs.python.org/3/library/dis.html#opcode-HAVE_ARGUMENT" }; case "IMPORT_FROM": return { "html": "

Loads the attribute co_names[namei] from the module found in STACK[-1].\nThe resulting object is pushed onto the stack, to be subsequently stored by a\nSTORE_FAST instruction.

\n", "tooltip": "Loads the attribute co_names[namei] from the module found in STACK[-1].\nThe resulting object is pushed onto the stack, to be subsequently stored by a\nSTORE_FAST instruction.", "url": "https://docs.python.org/3/library/dis.html#opcode-IMPORT_FROM" }; case "IMPORT_NAME": return { "html": "

Imports the module co_names[namei]. STACK[-1] and STACK[-2] are\npopped and provide the fromlist and level arguments of __import__().\nThe module object is pushed onto the stack. The current namespace is not affected: for a proper import statement, a subsequent STORE_FAST instruction\nmodifies the namespace.

\n", "tooltip": "Imports the module co_names[namei]. STACK[-1] and STACK[-2] are\npopped and provide the fromlist and level arguments of __import__().\nThe module object is pushed onto the stack. The current namespace is not affected: for a proper import statement, a subsequent STORE_FAST instruction\nmodifies the namespace.", "url": "https://docs.python.org/3/library/dis.html#opcode-IMPORT_NAME" }; case "IS_OP": return { "html": "

Performs is comparison, or is not if invert is 1.

\n\n

Added in version 3.9.

\n\n", "tooltip": "Performs is comparison, or is not if invert is 1.", "url": "https://docs.python.org/3/library/dis.html#opcode-IS_OP" }; case "JUMP": return { "html": "", "tooltip": "", "url": "https://docs.python.org/3/library/dis.html#opcode-JUMP" }; case "JUMP_BACKWARD": return { "html": "

Decrements bytecode counter by delta. Checks for interrupts.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Decrements bytecode counter by delta. Checks for interrupts.", "url": "https://docs.python.org/3/library/dis.html#opcode-JUMP_BACKWARD" }; case "JUMP_BACKWARD_NO_INTERRUPT": return { "html": "

Decrements bytecode counter by delta. Does not check for interrupts.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Decrements bytecode counter by delta. Does not check for interrupts.", "url": "https://docs.python.org/3/library/dis.html#opcode-JUMP_BACKWARD_NO_INTERRUPT" }; case "JUMP_FORWARD": return { "html": "

Increments bytecode counter by delta.

\n", "tooltip": "Increments bytecode counter by delta.", "url": "https://docs.python.org/3/library/dis.html#opcode-JUMP_FORWARD" }; case "JUMP_NO_INTERRUPT": return { "html": "

Undirected relative jump instructions which are replaced by their\ndirected (forward/backward) counterparts by the assembler.

\n", "tooltip": "Undirected relative jump instructions which are replaced by their\ndirected (forward/backward) counterparts by the assembler.", "url": "https://docs.python.org/3/library/dis.html#opcode-JUMP_NO_INTERRUPT" }; case "LIST_APPEND": return { "html": "

Implements:

\n
item = STACK.pop()\nlist.append(STACK[-i], item)\n
\n\n

Used to implement list comprehensions.

\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-LIST_APPEND" }; case "LIST_EXTEND": return { "html": "

Implements:

\n
seq = STACK.pop()\nlist.extend(STACK[-i], seq)\n
\n\n

Used to build lists.

\n\n

Added in version 3.9.

\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-LIST_EXTEND" }; case "LOAD_ASSERTION_ERROR": return { "html": "

Pushes AssertionError onto the stack. Used by the assert\nstatement.

\n\n

Added in version 3.9.

\n\n", "tooltip": "Pushes AssertionError onto the stack. Used by the assert\nstatement.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_ASSERTION_ERROR" }; case "LOAD_ATTR": return { "html": "

If the low bit of namei is not set, this replaces STACK[-1] with\ngetattr(STACK[-1], co_names[namei>>1]).

\n

If the low bit of namei is set, this will attempt to load a method named\nco_names[namei>>1] from the STACK[-1] object. STACK[-1] is popped.\nThis bytecode distinguishes two cases: if STACK[-1] has a method with the\ncorrect name, the bytecode pushes the unbound method and STACK[-1].\nSTACK[-1] will be used as the first argument (self) by CALL\nor CALL_KW when calling the unbound method.\nOtherwise, NULL and the object returned by\nthe attribute lookup are pushed.

\n\n

Changed in version 3.12: If the low bit of namei is set, then a NULL or self is\npushed to the stack before the attribute or unbound method respectively.

\n\n", "tooltip": "If the low bit of namei is not set, this replaces STACK[-1] with\ngetattr(STACK[-1], co_names[namei>>1]).", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_ATTR" }; case "LOAD_BUILD_CLASS": return { "html": "

Pushes builtins.__build_class__() onto the stack. It is later called\nto construct a class.

\n", "tooltip": "Pushes builtins.__build_class__() onto the stack. It is later called\nto construct a class.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_BUILD_CLASS" }; case "LOAD_CLOSURE": return { "html": "

Pushes a reference to the cell contained in slot i of the \u201cfast locals\u201d\nstorage.

\n

Note that LOAD_CLOSURE is replaced with LOAD_FAST in the assembler.

\n\n

Changed in version 3.13: This opcode is now a pseudo-instruction.

\n\n", "tooltip": "Pushes a reference to the cell contained in slot i of the \u201cfast locals\u201d\nstorage.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_CLOSURE" }; case "LOAD_CONST": return { "html": "

Pushes co_consts[consti] onto the stack.

\n", "tooltip": "Pushes co_consts[consti] onto the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_CONST" }; case "LOAD_DEREF": return { "html": "

Loads the cell contained in slot i of the \u201cfast locals\u201d storage.\nPushes a reference to the object the cell contains on the stack.

\n\n

Changed in version 3.11: i is no longer offset by the length of co_varnames.

\n\n", "tooltip": "Loads the cell contained in slot i of the \u201cfast locals\u201d storage.\nPushes a reference to the object the cell contains on the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_DEREF" }; case "LOAD_FAST": return { "html": "

Pushes a reference to the local co_varnames[var_num] onto the stack.

\n\n

Changed in version 3.12: This opcode is now only used in situations where the local variable is\nguaranteed to be initialized. It cannot raise UnboundLocalError.

\n\n", "tooltip": "Pushes a reference to the local co_varnames[var_num] onto the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_FAST" }; case "LOAD_FAST_AND_CLEAR": return { "html": "

Pushes a reference to the local co_varnames[var_num] onto the stack (or\npushes NULL onto the stack if the local variable has not been\ninitialized) and sets co_varnames[var_num] to NULL.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Pushes a reference to the local co_varnames[var_num] onto the stack (or\npushes NULL onto the stack if the local variable has not been\ninitialized) and sets co_varnames[var_num] to NULL.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_FAST_AND_CLEAR" }; case "LOAD_FAST_CHECK": return { "html": "

Pushes a reference to the local co_varnames[var_num] onto the stack,\nraising an UnboundLocalError if the local variable has not been\ninitialized.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Pushes a reference to the local co_varnames[var_num] onto the stack,\nraising an UnboundLocalError if the local variable has not been\ninitialized.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_FAST_CHECK" }; case "LOAD_FAST_LOAD_FAST": return { "html": "

Pushes references to co_varnames[var_nums >> 4] and\nco_varnames[var_nums & 15] onto the stack.

\n\n

Added in version 3.13.

\n\n", "tooltip": "Pushes references to co_varnames[var_nums >> 4] and\nco_varnames[var_nums & 15] onto the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_FAST_LOAD_FAST" }; case "LOAD_FROM_DICT_OR_DEREF": return { "html": "

Pops a mapping off the stack and looks up the name associated with\nslot i of the \u201cfast locals\u201d storage in this mapping.\nIf the name is not found there, loads it from the cell contained in\nslot i, similar to LOAD_DEREF. This is used for loading\nclosure variables in class bodies (which previously used\nLOAD_CLASSDEREF) and in\nannotation scopes within class bodies.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Pops a mapping off the stack and looks up the name associated with\nslot i of the \u201cfast locals\u201d storage in this mapping.\nIf the name is not found there, loads it from the cell contained in\nslot i, similar to LOAD_DEREF. This is used for loading\nclosure variables in class bodies (which previously used\nLOAD_CLASSDEREF) and in\nannotation scopes within class bodies.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_FROM_DICT_OR_DEREF" }; case "LOAD_FROM_DICT_OR_GLOBALS": return { "html": "

Pops a mapping off the stack and looks up the value for co_names[namei].\nIf the name is not found there, looks it up in the globals and then the builtins,\nsimilar to LOAD_GLOBAL.\nThis is used for loading global variables in\nannotation scopes within class bodies.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Pops a mapping off the stack and looks up the value for co_names[namei].\nIf the name is not found there, looks it up in the globals and then the builtins,\nsimilar to LOAD_GLOBAL.\nThis is used for loading global variables in\nannotation scopes within class bodies.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_FROM_DICT_OR_GLOBALS" }; case "LOAD_GLOBAL": return { "html": "

Loads the global named co_names[namei>>1] onto the stack.

\n\n

Changed in version 3.11: If the low bit of namei is set, then a NULL is pushed to the\nstack before the global variable.

\n\n", "tooltip": "Loads the global named co_names[namei>>1] onto the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_GLOBAL" }; case "LOAD_LOCALS": return { "html": "

Pushes a reference to the locals dictionary onto the stack. This is used\nto prepare namespace dictionaries for LOAD_FROM_DICT_OR_DEREF\nand LOAD_FROM_DICT_OR_GLOBALS.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Pushes a reference to the locals dictionary onto the stack. This is used\nto prepare namespace dictionaries for LOAD_FROM_DICT_OR_DEREF\nand LOAD_FROM_DICT_OR_GLOBALS.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_LOCALS" }; case "LOAD_METHOD": return { "html": "

Optimized unbound method lookup. Emitted as a LOAD_ATTR opcode\nwith a flag set in the arg.

\n", "tooltip": "Optimized unbound method lookup. Emitted as a LOAD_ATTR opcode\nwith a flag set in the arg.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_METHOD" }; case "LOAD_NAME": return { "html": "

Pushes the value associated with co_names[namei] onto the stack.\nThe name is looked up within the locals, then the globals, then the builtins.

\n", "tooltip": "Pushes the value associated with co_names[namei] onto the stack.\nThe name is looked up within the locals, then the globals, then the builtins.", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_NAME" }; case "LOAD_SUPER_ATTR": return { "html": "

This opcode implements super(), both in its zero-argument and\ntwo-argument forms (e.g. super().method(), super().attr and\nsuper(cls, self).method(), super(cls, self).attr).

\n

It pops three values from the stack (from top of stack down):

\n\n

With respect to its argument, it works similarly to LOAD_ATTR,\nexcept that namei is shifted left by 2 bits instead of 1.

\n

The low bit of namei signals to attempt a method load, as with\nLOAD_ATTR, which results in pushing NULL and the loaded method.\nWhen it is unset a single value is pushed to the stack.

\n

The second-low bit of namei, if set, means that this was a two-argument\ncall to super() (unset means zero-argument).

\n\n

Added in version 3.12.

\n\n", "tooltip": "This opcode implements super(), both in its zero-argument and\ntwo-argument forms (e.g. super().method(), super().attr and\nsuper(cls, self).method(), super(cls, self).attr).", "url": "https://docs.python.org/3/library/dis.html#opcode-LOAD_SUPER_ATTR" }; case "MAKE_CELL": return { "html": "

Creates a new cell in slot i. If that slot is nonempty then\nthat value is stored into the new cell.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Creates a new cell in slot i. If that slot is nonempty then\nthat value is stored into the new cell.", "url": "https://docs.python.org/3/library/dis.html#opcode-MAKE_CELL" }; case "MAKE_FUNCTION": return { "html": "

Pushes a new function object on the stack built from the code object at STACK[-1].

\n\n

Changed in version 3.10: Flag value 0x04 is a tuple of strings instead of dictionary

\n\n\n

Changed in version 3.11: Qualified name at STACK[-1] was removed.

\n\n\n

Changed in version 3.13: Extra function attributes on the stack, signaled by oparg flags, were\nremoved. They now use SET_FUNCTION_ATTRIBUTE.

\n\n", "tooltip": "Pushes a new function object on the stack built from the code object at STACK[-1].", "url": "https://docs.python.org/3/library/dis.html#opcode-MAKE_FUNCTION" }; case "MAP_ADD": return { "html": "

Implements:

\n
value = STACK.pop()\nkey = STACK.pop()\ndict.__setitem__(STACK[-i], key, value)\n
\n\n

Used to implement dict comprehensions.

\n\n

Added in version 3.1.

\n\n\n

Changed in version 3.8: Map value is STACK[-1] and map key is STACK[-2]. Before, those\nwere reversed.

\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-MAP_ADD" }; case "MATCH_CLASS": return { "html": "

STACK[-1] is a tuple of keyword attribute names, STACK[-2] is the class\nbeing matched against, and STACK[-3] is the match subject. count is the\nnumber of positional sub-patterns.

\n

Pop STACK[-1], STACK[-2], and STACK[-3]. If STACK[-3] is an\ninstance of STACK[-2] and has the positional and keyword attributes\nrequired by count and STACK[-1], push a tuple of extracted attributes.\nOtherwise, push None.

\n\n

Added in version 3.10.

\n\n\n

Changed in version 3.11: Previously, this instruction also pushed a boolean value indicating\nsuccess (True) or failure (False).

\n\n", "tooltip": "STACK[-1] is a tuple of keyword attribute names, STACK[-2] is the class\nbeing matched against, and STACK[-3] is the match subject. count is the\nnumber of positional sub-patterns.", "url": "https://docs.python.org/3/library/dis.html#opcode-MATCH_CLASS" }; case "MATCH_KEYS": return { "html": "

STACK[-1] is a tuple of mapping keys, and STACK[-2] is the match subject.\nIf STACK[-2] contains all of the keys in STACK[-1], push a tuple\ncontaining the corresponding values. Otherwise, push None.

\n\n

Added in version 3.10.

\n\n\n

Changed in version 3.11: Previously, this instruction also pushed a boolean value indicating\nsuccess (True) or failure (False).

\n\n", "tooltip": "STACK[-1] is a tuple of mapping keys, and STACK[-2] is the match subject.\nIf STACK[-2] contains all of the keys in STACK[-1], push a tuple\ncontaining the corresponding values. Otherwise, push None.", "url": "https://docs.python.org/3/library/dis.html#opcode-MATCH_KEYS" }; case "MATCH_MAPPING": return { "html": "

If STACK[-1] is an instance of collections.abc.Mapping (or, more\ntechnically: if it has the Py_TPFLAGS_MAPPING flag set in its\ntp_flags), push True onto the stack. Otherwise,\npush False.

\n\n

Added in version 3.10.

\n\n", "tooltip": "If STACK[-1] is an instance of collections.abc.Mapping (or, more\ntechnically: if it has the Py_TPFLAGS_MAPPING flag set in its\ntp_flags), push True onto the stack. Otherwise,\npush False.", "url": "https://docs.python.org/3/library/dis.html#opcode-MATCH_MAPPING" }; case "MATCH_SEQUENCE": return { "html": "

If STACK[-1] is an instance of collections.abc.Sequence and is not an instance\nof str/bytes/bytearray (or, more technically: if it has\nthe Py_TPFLAGS_SEQUENCE flag set in its tp_flags),\npush True onto the stack. Otherwise, push False.

\n\n

Added in version 3.10.

\n\n", "tooltip": "If STACK[-1] is an instance of collections.abc.Sequence and is not an instance\nof str/bytes/bytearray (or, more technically: if it has\nthe Py_TPFLAGS_SEQUENCE flag set in its tp_flags),\npush True onto the stack. Otherwise, push False.", "url": "https://docs.python.org/3/library/dis.html#opcode-MATCH_SEQUENCE" }; case "NOP": return { "html": "

Do nothing code. Used as a placeholder by the bytecode optimizer, and to\ngenerate line tracing events.

\n", "tooltip": "Do nothing code. Used as a placeholder by the bytecode optimizer, and to\ngenerate line tracing events.", "url": "https://docs.python.org/3/library/dis.html#opcode-NOP" }; case "POP_BLOCK": return { "html": "

Marks the end of the code block associated with the last SETUP_FINALLY,\nSETUP_CLEANUP or SETUP_WITH.

\n", "tooltip": "Marks the end of the code block associated with the last SETUP_FINALLY,\nSETUP_CLEANUP or SETUP_WITH.", "url": "https://docs.python.org/3/library/dis.html#opcode-POP_BLOCK" }; case "POP_EXCEPT": return { "html": "

Pops a value from the stack, which is used to restore the exception state.

\n\n

Changed in version 3.11: Exception representation on the stack now consist of one, not three, items.

\n\n", "tooltip": "Pops a value from the stack, which is used to restore the exception state.", "url": "https://docs.python.org/3/library/dis.html#opcode-POP_EXCEPT" }; case "POP_JUMP_IF_FALSE": return { "html": "

If STACK[-1] is false, increments the bytecode counter by delta.\nSTACK[-1] is popped.

\n\n

Changed in version 3.11: The oparg is now a relative delta rather than an absolute target.\nThis opcode is a pseudo-instruction, replaced in final bytecode by\nthe directed versions (forward/backward).

\n\n\n

Changed in version 3.12: This is no longer a pseudo-instruction.

\n\n\n

Changed in version 3.13: This instruction now requires an exact bool operand.

\n\n", "tooltip": "If STACK[-1] is false, increments the bytecode counter by delta.\nSTACK[-1] is popped.", "url": "https://docs.python.org/3/library/dis.html#opcode-POP_JUMP_IF_FALSE" }; case "POP_JUMP_IF_NONE": return { "html": "

If STACK[-1] is None, increments the bytecode counter by delta.\nSTACK[-1] is popped.

\n\n

Added in version 3.11.

\n\n\n

Changed in version 3.12: This is no longer a pseudo-instruction.

\n\n", "tooltip": "If STACK[-1] is None, increments the bytecode counter by delta.\nSTACK[-1] is popped.", "url": "https://docs.python.org/3/library/dis.html#opcode-POP_JUMP_IF_NONE" }; case "POP_JUMP_IF_NOT_NONE": return { "html": "

If STACK[-1] is not None, increments the bytecode counter by delta.\nSTACK[-1] is popped.

\n\n

Added in version 3.11.

\n\n\n

Changed in version 3.12: This is no longer a pseudo-instruction.

\n\n", "tooltip": "If STACK[-1] is not None, increments the bytecode counter by delta.\nSTACK[-1] is popped.", "url": "https://docs.python.org/3/library/dis.html#opcode-POP_JUMP_IF_NOT_NONE" }; case "POP_JUMP_IF_TRUE": return { "html": "

If STACK[-1] is true, increments the bytecode counter by delta.\nSTACK[-1] is popped.

\n\n

Changed in version 3.11: The oparg is now a relative delta rather than an absolute target.\nThis opcode is a pseudo-instruction, replaced in final bytecode by\nthe directed versions (forward/backward).

\n\n\n

Changed in version 3.12: This is no longer a pseudo-instruction.

\n\n\n

Changed in version 3.13: This instruction now requires an exact bool operand.

\n\n", "tooltip": "If STACK[-1] is true, increments the bytecode counter by delta.\nSTACK[-1] is popped.", "url": "https://docs.python.org/3/library/dis.html#opcode-POP_JUMP_IF_TRUE" }; case "POP_TOP": return { "html": "

Removes the top-of-stack item:

\n
STACK.pop()\n
\n\n", "tooltip": "Removes the top-of-stack item", "url": "https://docs.python.org/3/library/dis.html#opcode-POP_TOP" }; case "PUSH_EXC_INFO": return { "html": "

Pops a value from the stack. Pushes the current exception to the top of the stack.\nPushes the value originally popped back to the stack.\nUsed in exception handlers.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Pops a value from the stack. Pushes the current exception to the top of the stack.\nPushes the value originally popped back to the stack.\nUsed in exception handlers.", "url": "https://docs.python.org/3/library/dis.html#opcode-PUSH_EXC_INFO" }; case "PUSH_NULL": return { "html": "

Pushes a NULL to the stack.\nUsed in the call sequence to match the NULL pushed by\nLOAD_METHOD for non-method calls.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Pushes a NULL to the stack.\nUsed in the call sequence to match the NULL pushed by\nLOAD_METHOD for non-method calls.", "url": "https://docs.python.org/3/library/dis.html#opcode-PUSH_NULL" }; case "RAISE_VARARGS": return { "html": "

Raises an exception using one of the 3 forms of the raise statement,\ndepending on the value of argc:

\n\n", "tooltip": "Raises an exception using one of the 3 forms of the raise statement,\ndepending on the value of argc", "url": "https://docs.python.org/3/library/dis.html#opcode-RAISE_VARARGS" }; case "RERAISE": return { "html": "

Re-raises the exception currently on top of the stack. If oparg is non-zero,\npops an additional value from the stack which is used to set\nf_lasti of the current frame.

\n\n

Added in version 3.9.

\n\n\n

Changed in version 3.11: Exception representation on the stack now consist of one, not three, items.

\n\n", "tooltip": "Re-raises the exception currently on top of the stack. If oparg is non-zero,\npops an additional value from the stack which is used to set\nf_lasti of the current frame.", "url": "https://docs.python.org/3/library/dis.html#opcode-RERAISE" }; case "RESUME": return { "html": "

A no-op. Performs internal tracing, debugging and optimization checks.

\n

The context oparand consists of two parts. The lowest two bits\nindicate where the RESUME occurs:

\n\n

The next bit is 1 if the RESUME is at except-depth 1, and 0\notherwise.

\n\n

Added in version 3.11.

\n\n\n

Changed in version 3.13: The oparg value changed to include information about except-depth

\n\n", "tooltip": "A no-op. Performs internal tracing, debugging and optimization checks.", "url": "https://docs.python.org/3/library/dis.html#opcode-RESUME" }; case "RETURN_CONST": return { "html": "

Returns with co_consts[consti] to the caller of the function.

\n\n

Added in version 3.12.

\n\n", "tooltip": "Returns with co_consts[consti] to the caller of the function.", "url": "https://docs.python.org/3/library/dis.html#opcode-RETURN_CONST" }; case "RETURN_GENERATOR": return { "html": "

Create a generator, coroutine, or async generator from the current frame.\nUsed as first opcode of in code object for the above mentioned callables.\nClear the current frame and return the newly created generator.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Create a generator, coroutine, or async generator from the current frame.\nUsed as first opcode of in code object for the above mentioned callables.\nClear the current frame and return the newly created generator.", "url": "https://docs.python.org/3/library/dis.html#opcode-RETURN_GENERATOR" }; case "RETURN_VALUE": return { "html": "

Returns with STACK[-1] to the caller of the function.

\n", "tooltip": "Returns with STACK[-1] to the caller of the function.", "url": "https://docs.python.org/3/library/dis.html#opcode-RETURN_VALUE" }; case "SEND": return { "html": "

Equivalent to STACK[-1] = STACK[-2].send(STACK[-1]). Used in yield from\nand await statements.

\n

If the call raises StopIteration, pop the top value from the stack,\npush the exception\u2019s value attribute, and increment the bytecode counter\nby delta.

\n\n

Added in version 3.11.

\n\n", "tooltip": "Equivalent to STACK[-1] = STACK[-2].send(STACK[-1]). Used in yield from\nand await statements.", "url": "https://docs.python.org/3/library/dis.html#opcode-SEND" }; case "SETUP_ANNOTATIONS": return { "html": "

Checks whether __annotations__ is defined in locals(), if not it is\nset up to an empty dict. This opcode is only emitted if a class\nor module body contains variable annotations\nstatically.

\n\n

Added in version 3.6.

\n\n", "tooltip": "Checks whether __annotations__ is defined in locals(), if not it is\nset up to an empty dict. This opcode is only emitted if a class\nor module body contains variable annotations\nstatically.", "url": "https://docs.python.org/3/library/dis.html#opcode-SETUP_ANNOTATIONS" }; case "SETUP_CLEANUP": return { "html": "

Like SETUP_FINALLY, but in case of an exception also pushes the last\ninstruction (lasti) to the stack so that RERAISE can restore it.\nIf an exception occurs, the value stack level and the last instruction on\nthe frame are restored to their current state, and control is transferred\nto the exception handler at target.

\n", "tooltip": "Like SETUP_FINALLY, but in case of an exception also pushes the last\ninstruction (lasti) to the stack so that RERAISE can restore it.\nIf an exception occurs, the value stack level and the last instruction on\nthe frame are restored to their current state, and control is transferred\nto the exception handler at target.", "url": "https://docs.python.org/3/library/dis.html#opcode-SETUP_CLEANUP" }; case "SETUP_FINALLY": return { "html": "

Set up an exception handler for the following code block. If an exception\noccurs, the value stack level is restored to its current state and control\nis transferred to the exception handler at target.

\n", "tooltip": "Set up an exception handler for the following code block. If an exception\noccurs, the value stack level is restored to its current state and control\nis transferred to the exception handler at target.", "url": "https://docs.python.org/3/library/dis.html#opcode-SETUP_FINALLY" }; case "SETUP_WITH": return { "html": "

Like SETUP_CLEANUP, but in case of an exception one more item is popped\nfrom the stack before control is transferred to the exception handler at\ntarget.

\n

This variant is used in with and async with\nconstructs, which push the return value of the context manager\u2019s\n__enter__() or __aenter__() to the stack.

\n", "tooltip": "Like SETUP_CLEANUP, but in case of an exception one more item is popped\nfrom the stack before control is transferred to the exception handler at\ntarget.", "url": "https://docs.python.org/3/library/dis.html#opcode-SETUP_WITH" }; case "SET_ADD": return { "html": "

Implements:

\n
item = STACK.pop()\nset.add(STACK[-i], item)\n
\n\n

Used to implement set comprehensions.

\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-SET_ADD" }; case "SET_FUNCTION_ATTRIBUTE": return { "html": "

Sets an attribute on a function object. Expects the function at STACK[-1]\nand the attribute value to set at STACK[-2]; consumes both and leaves the\nfunction at STACK[-1]. The flag determines which attribute to set:

\n\n\n

Added in version 3.13.

\n\n", "tooltip": "Sets an attribute on a function object. Expects the function at STACK[-1]\nand the attribute value to set at STACK[-2]; consumes both and leaves the\nfunction at STACK[-1]. The flag determines which attribute to set", "url": "https://docs.python.org/3/library/dis.html#opcode-SET_FUNCTION_ATTRIBUTE" }; case "SET_UPDATE": return { "html": "

Implements:

\n
seq = STACK.pop()\nset.update(STACK[-i], seq)\n
\n\n

Used to build sets.

\n\n

Added in version 3.9.

\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-SET_UPDATE" }; case "STORE_ATTR": return { "html": "

Implements:

\n
obj = STACK.pop()\nvalue = STACK.pop()\nobj.name = value\n
\n\n

where namei is the index of name in co_names of the\ncode object.

\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_ATTR" }; case "STORE_DEREF": return { "html": "

Stores STACK.pop() into the cell contained in slot i of the \u201cfast locals\u201d\nstorage.

\n\n

Changed in version 3.11: i is no longer offset by the length of co_varnames.

\n\n", "tooltip": "Stores STACK.pop() into the cell contained in slot i of the \u201cfast locals\u201d\nstorage.", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_DEREF" }; case "STORE_FAST": return { "html": "

Stores STACK.pop() into the local co_varnames[var_num].

\n", "tooltip": "Stores STACK.pop() into the local co_varnames[var_num].", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_FAST" }; case "STORE_FAST_LOAD_FAST": return { "html": "

Stores STACK.pop() into the local co_varnames[var_nums >> 4]\nand pushes a reference to the local co_varnames[var_nums & 15]\nonto the stack.

\n\n

Added in version 3.13.

\n\n", "tooltip": "Stores STACK.pop() into the local co_varnames[var_nums >> 4]\nand pushes a reference to the local co_varnames[var_nums & 15]\nonto the stack.", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_FAST_LOAD_FAST" }; case "STORE_FAST_STORE_FAST": return { "html": "

Stores STACK[-1] into co_varnames[var_nums >> 4]\nand STACK[-2] into co_varnames[var_nums & 15].

\n\n

Added in version 3.13.

\n\n", "tooltip": "Stores STACK[-1] into co_varnames[var_nums >> 4]\nand STACK[-2] into co_varnames[var_nums & 15].", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_FAST_STORE_FAST" }; case "STORE_GLOBAL": return { "html": "

Works as STORE_NAME, but stores the name as a global.

\n", "tooltip": "Works as STORE_NAME, but stores the name as a global.", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_GLOBAL" }; case "STORE_NAME": return { "html": "

Implements name = STACK.pop(). namei is the index of name in the attribute\nco_names of the code object.\nThe compiler tries to use STORE_FAST or STORE_GLOBAL if possible.

\n", "tooltip": "Implements name = STACK.pop(). namei is the index of name in the attribute\nco_names of the code object.\nThe compiler tries to use STORE_FAST or STORE_GLOBAL if possible.", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_NAME" }; case "STORE_SLICE": return { "html": "

Implements:

\n
end = STACK.pop()\nstart = STACK.pop()\ncontainer = STACK.pop()\nvalues = STACK.pop()\ncontainer[start:end] = value\n
\n\n\n

Added in version 3.12.

\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_SLICE" }; case "STORE_SUBSCR": return { "html": "

Implements:

\n
key = STACK.pop()\ncontainer = STACK.pop()\nvalue = STACK.pop()\ncontainer[key] = value\n
\n\n", "tooltip": "Implements", "url": "https://docs.python.org/3/library/dis.html#opcode-STORE_SUBSCR" }; case "SWAP": return { "html": "

Swap the top of the stack with the i-th element:

\n
STACK[-i], STACK[-1] = STACK[-1], STACK[-i]\n
\n\n\n

Added in version 3.11.

\n\n", "tooltip": "Swap the top of the stack with the i-th element", "url": "https://docs.python.org/3/library/dis.html#opcode-SWAP" }; case "TO_BOOL": return { "html": "

Implements STACK[-1] = bool(STACK[-1]).

\n\n

Added in version 3.13.

\n\n", "tooltip": "Implements STACK[-1] = bool(STACK[-1]).", "url": "https://docs.python.org/3/library/dis.html#opcode-TO_BOOL" }; case "UNARY_INVERT": return { "html": "

Implements STACK[-1] = ~STACK[-1].

\n", "tooltip": "Implements STACK[-1] = ~STACK[-1].", "url": "https://docs.python.org/3/library/dis.html#opcode-UNARY_INVERT" }; case "UNARY_NEGATIVE": return { "html": "

Implements STACK[-1] = -STACK[-1].

\n", "tooltip": "Implements STACK[-1] = -STACK[-1].", "url": "https://docs.python.org/3/library/dis.html#opcode-UNARY_NEGATIVE" }; case "UNARY_NOT": return { "html": "

Implements STACK[-1] = not STACK[-1].

\n\n

Changed in version 3.13: This instruction now requires an exact bool operand.

\n\n", "tooltip": "Implements STACK[-1] = not STACK[-1].", "url": "https://docs.python.org/3/library/dis.html#opcode-UNARY_NOT" }; case "UNPACK_EX": return { "html": "

Implements assignment with a starred target: Unpacks an iterable in STACK[-1]\ninto individual values, where the total number of values can be smaller than the\nnumber of items in the iterable: one of the new values will be a list of all\nleftover items.

\n

The number of values before and after the list value is limited to 255.

\n

The number of values before the list value is encoded in the argument of the\nopcode. The number of values after the list if any is encoded using an\nEXTENDED_ARG. As a consequence, the argument can be seen as a two bytes values\nwhere the low byte of counts is the number of values before the list value, the\nhigh byte of counts the number of values after it.

\n

The extracted values are put onto the stack right-to-left, i.e. a, *b, c = d\nwill be stored after execution as STACK.extend((a, b, c)).

\n", "tooltip": "Implements assignment with a starred target: Unpacks an iterable in STACK[-1]\ninto individual values, where the total number of values can be smaller than the\nnumber of items in the iterable: one of the new values will be a list of all\nleftover items.", "url": "https://docs.python.org/3/library/dis.html#opcode-UNPACK_EX" }; case "UNPACK_SEQUENCE": return { "html": "

Unpacks STACK[-1] into count individual values, which are put onto the stack\nright-to-left. Require there to be exactly count values.:

\n
assert(len(STACK[-1]) == count)\nSTACK.extend(STACK.pop()[:-count-1:-1])\n
\n\n", "tooltip": "Unpacks STACK[-1] into count individual values, which are put onto the stack\nright-to-left. Require there to be exactly count values.", "url": "https://docs.python.org/3/library/dis.html#opcode-UNPACK_SEQUENCE" }; case "WITH_EXCEPT_START": return { "html": "

Calls the function in position 4 on the stack with arguments (type, val, tb)\nrepresenting the exception at the top of the stack.\nUsed to implement the call context_manager.__exit__(*exc_info()) when an exception\nhas occurred in a with statement.

\n\n

Added in version 3.9.

\n\n\n

Changed in version 3.11: The __exit__ function is in position 4 of the stack rather than 7.\nException representation on the stack now consist of one, not three, items.

\n\n", "tooltip": "Calls the function in position 4 on the stack with arguments (type, val, tb)\nrepresenting the exception at the top of the stack.\nUsed to implement the call context_manager.__exit__(*exc_info()) when an exception\nhas occurred in a with statement.", "url": "https://docs.python.org/3/library/dis.html#opcode-WITH_EXCEPT_START" }; case "YIELD_VALUE": return { "html": "

Yields STACK.pop() from a generator.

\n\n

Changed in version 3.11: oparg set to be the stack depth.

\n\n\n

Changed in version 3.12: oparg set to be the exception block depth, for efficient closing of generators.

\n\n\n

Changed in version 3.13: oparg is 1 if this instruction is part of a yield-from or await, and 0\notherwise.

\n\n", "tooltip": "Yields STACK.pop() from a generator.", "url": "https://docs.python.org/3/library/dis.html#opcode-YIELD_VALUE" }; } }