[Python-checkins] CVS: python/dist/src/Doc/lib libdis.tex,1.21,1.22

Thomas Wouters python-dev@python.org
Thu, 17 Aug 2000 15:55:01 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv24798/Doc/lib

Modified Files:
	libdis.tex 
Log Message:

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.



Index: libdis.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdis.tex,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** libdis.tex	2000/08/17 22:19:26	1.21
--- libdis.tex	2000/08/17 22:54:59	1.22
***************
*** 302,305 ****
--- 302,311 ----
  \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
***************
*** 412,417 ****
  
  \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.
  \end{opcodedesc}
  
--- 418,424 ----
  
  \begin{opcodedesc}{IMPORT_FROM}{namei}
! 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}