diff options
author | Thomas Wouters <thomas@python.org> | 2000-08-17 22:55:00 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2000-08-17 22:55:00 (GMT) |
commit | 5215225ea1e3200b572775639d567f5e3f489a15 (patch) | |
tree | 8202d4aebf513dc8c8a80adf018f13270386e658 /Doc/lib/libdis.tex | |
parent | 1d75a79c009e500923128716a02efbe86135e64e (diff) | |
download | cpython-5215225ea1e3200b572775639d567f5e3f489a15.zip cpython-5215225ea1e3200b572775639d567f5e3f489a15.tar.gz cpython-5215225ea1e3200b572775639d567f5e3f489a15.tar.bz2 |
Apply SF patch #101135, adding 'import module as m' and 'from module import
name as n'. By doing some twists and turns, "as" is not a reserved word.
There is a slight change in semantics for 'from module import name' (it will
now honour the 'global' keyword) but only in cases that are explicitly
undocumented.
Diffstat (limited to 'Doc/lib/libdis.tex')
-rw-r--r-- | Doc/lib/libdis.tex | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/lib/libdis.tex b/Doc/lib/libdis.tex index e80515c..e6d3c77 100644 --- a/Doc/lib/libdis.tex +++ b/Doc/lib/libdis.tex @@ -301,6 +301,12 @@ is evaluated, the locals are passed to the class definition. Returns with TOS to the caller of the function. \end{opcodedesc} +\begin{opcodedesc}{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 *'. +\begin{opcodedesc} + \begin{opcodedesc}{EXEC_STMT}{} Implements \code{exec TOS2,TOS1,TOS}. The compiler fills missing optional parameters with None. @@ -411,8 +417,9 @@ modifies the name space. \end{opcodedesc} \begin{opcodedesc}{IMPORT_FROM}{namei} -Imports the attribute \code{co_names[\var{namei}]}. The module to import -from is found in TOS and left there. +Loads the attribute \code{co_names[\var{namei}]} from the module found in +TOS. The resulting object is pushed onto the stack, to be subsequently +stored by a \code{STORE_FAST} instruction. \end{opcodedesc} \begin{opcodedesc}{JUMP_FORWARD}{delta} |