diff options
author | Mark Shannon <mark@hotpy.org> | 2023-01-05 16:05:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-05 16:05:51 (GMT) |
commit | 28187141cc34063ef857976ddbca87ba09a882c2 (patch) | |
tree | 852d652bd98f0f7e322a30f6d648a1a4ce9612b2 /Doc/library/dis.rst | |
parent | f20c553a458659f247fac1fb829f8172aa32f69a (diff) | |
download | cpython-28187141cc34063ef857976ddbca87ba09a882c2.zip cpython-28187141cc34063ef857976ddbca87ba09a882c2.tar.gz cpython-28187141cc34063ef857976ddbca87ba09a882c2.tar.bz2 |
GH-99005: Add `CALL_INTRINSIC_1` instruction (GH-100771)
* Remove PRINT_EXPR instruction
* Remove STOPITERATION_ERROR instruction
* Remove IMPORT_STAR instruction
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r-- | Doc/library/dis.rst | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 30bbf95..33ef6d7 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -607,15 +607,6 @@ the original TOS1. .. versionadded:: 3.12 -.. opcode:: STOPITERATION_ERROR - - Handles a StopIteration raised in a generator or coroutine. - If TOS is an instance of :exc:`StopIteration`, or :exc:`StopAsyncIteration` - replace it with a :exc:`RuntimeError`. - - .. versionadded:: 3.12 - - .. opcode:: BEFORE_ASYNC_WITH Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the @@ -627,13 +618,6 @@ the original TOS1. **Miscellaneous opcodes** -.. opcode:: PRINT_EXPR - - Implements the expression statement for the interactive mode. TOS is removed - from the stack and printed. In non-interactive mode, an expression statement - is terminated with :opcode:`POP_TOP`. - - .. opcode:: SET_ADD (i) Calls ``set.add(TOS1[-i], TOS)``. Used to implement set comprehensions. @@ -682,13 +666,6 @@ iterations of the loop. .. versionadded:: 3.6 -.. opcode:: IMPORT_STAR - - Loads all symbols not starting with ``'_'`` directly from the module TOS to - the local namespace. The module is popped after loading all names. This - opcode implements ``from module import *``. - - .. opcode:: POP_EXCEPT Pops a value from the stack, which is used to restore the exception state. @@ -1422,6 +1399,22 @@ iterations of the loop. they use their arg. +.. opcode:: CALL_INTRINSIC_1 + + Calls an intrinsic function with one argument. Passes the TOS as the argument + and sets TOS to the result. Used to implement functionality that is necessary + but not performance critical. + + The operand determines which intrinsic function is called: + + * ``0`` Not valid + * ``1`` Prints the argument to standard out. Used in the REPL. + * ``2`` Performs ``import *`` for the named module. + * ``3`` Extracts the return value from a ``StopIteration`` exception. + + .. versionadded:: 3.12 + + **Pseudo-instructions** These opcodes do not appear in python bytecode, they are used by the compiler |