[Python-checkins] python/dist/src/Doc/lib libdis.tex,1.33.10.1,1.33.10.2
nnorwitz@users.sourceforge.net
nnorwitz@users.sourceforge.net
Wed, 26 Jun 2002 15:37:31 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv26018/Doc/lib
Modified Files:
Tag: release22-maint
libdis.tex
Log Message:
Backport 1.37: dis.dis() also supports modules, (also backport other changes back to 1.33 since these all apply to 2.2)
Index: libdis.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdis.tex,v
retrieving revision 1.33.10.1
retrieving revision 1.33.10.2
diff -C2 -d -r1.33.10.1 -r1.33.10.2
*** libdis.tex 28 Mar 2002 19:35:33 -0000 1.33.10.1
--- libdis.tex 26 Jun 2002 22:37:28 -0000 1.33.10.2
***************
*** 39,43 ****
\begin{funcdesc}{dis}{\optional{bytesource}}
Disassemble the \var{bytesource} object. \var{bytesource} can denote
! either a class, a method, a function, or a code object. For a class,
it disassembles all methods. For a single code sequence, it prints
one line per byte code instruction. If no object is provided, it
--- 39,44 ----
\begin{funcdesc}{dis}{\optional{bytesource}}
Disassemble the \var{bytesource} object. \var{bytesource} can denote
! either a module, a class, a method, a function, or a code object.
! For a module, it disassembles all functions. For a class,
it disassembles all methods. For a single code sequence, it prints
one line per byte code instruction. If no object is provided, it
***************
*** 167,170 ****
--- 168,175 ----
\end{opcodedesc}
+ \begin{opcodedesc}{GET_ITER}{}
+ Implements \code{TOS = iter(TOS)}.
+ \end{opcodedesc}
+
Binary operations remove the top of the stack (TOS) and the second top-most
stack item (TOS1) from the stack. They perform the operation, and put the
***************
*** 180,184 ****
\begin{opcodedesc}{BINARY_DIVIDE}{}
! Implements \code{TOS = TOS1 / TOS}.
\end{opcodedesc}
--- 185,199 ----
\begin{opcodedesc}{BINARY_DIVIDE}{}
! Implements \code{TOS = TOS1 / TOS} when
! \code{from __future__ import division} is not in effect.
! \end{opcodedesc}
!
! \begin{opcodedesc}{BINARY_FLOOR_DIVIDE}{}
! Implements \code{TOS = TOS1 // TOS}.
! \end{opcodedesc}
!
! \begin{opcodedesc}{BINARY_TRUE_DIVIDE}{}
! Implements \code{TOS = TOS1 / TOS} when
! \code{from __future__ import division} is in effect.
\end{opcodedesc}
***************
*** 233,237 ****
\begin{opcodedesc}{INPLACE_DIVIDE}{}
! Implements in-place \code{TOS = TOS1 / TOS}.
\end{opcodedesc}
--- 248,262 ----
\begin{opcodedesc}{INPLACE_DIVIDE}{}
! Implements in-place \code{TOS = TOS1 / TOS} when
! \code{from __future__ import division} is not in effect.
! \end{opcodedesc}
!
! \begin{opcodedesc}{INPLACE_FLOOR_DIVIDE}{}
! Implements in-place \code{TOS = TOS1 // TOS}.
! \end{opcodedesc}
!
! \begin{opcodedesc}{INPLACE_TRUE_DIVIDE}{}
! Implements in-place \code{TOS = TOS1 / TOS} when
! \code{from __future__ import division} is in effect.
\end{opcodedesc}
***************
*** 329,332 ****
--- 354,359 ----
\end{opcodedesc}
+ Miscellaneous opcodes.
+
\begin{opcodedesc}{PRINT_EXPR}{}
Implements the expression statement for the interactive mode. TOS is
***************
*** 360,363 ****
--- 387,396 ----
\end{opcodedesc}
+ \begin{opcodedesc}{CONTINUE_LOOP}{target}
+ Continues a loop due to a \keyword{continue} statement. \var{target}
+ is the address to jump to (which should be a \code{FOR_ITER}
+ instruction).
+ \end{opcodedesc}
+
\begin{opcodedesc}{LOAD_LOCALS}{}
Pushes a reference to the locals of the current scope on the stack.
***************
*** 370,373 ****
--- 403,410 ----
\end{opcodedesc}
+ \begin{opcodedesc}{YIELD_VALUE}{}
+ Pops \code{TOS} and yields it from a generator.
+ \end{opcodedesc}
+
\begin{opcodedesc}{IMPORT_STAR}{}
Loads all symbols not starting with \character{_} directly from the module TOS
***************
*** 514,523 ****
\end{opcodedesc}
! \begin{opcodedesc}{FOR_LOOP}{delta}
! Iterate over a sequence. TOS is the current index, TOS1 the sequence.
! First, the next element is computed. If the sequence is exhausted,
! increment byte code counter by \var{delta}. Otherwise, push the
! sequence, the incremented counter, and the current item onto the stack.
\end{opcodedesc}
%\begin{opcodedesc}{LOAD_LOCAL}{namei}
--- 551,564 ----
\end{opcodedesc}
! \begin{opcodedesc}{FOR_ITER}{delta}
! \code{TOS} is an iterator. Call its \method{next()} method. If this
! yields a new value, push it on the stack (leaving the iterator below
! it). If the iterator indicates it is exhausted \code{TOS} is
! popped, and the byte code counter is incremented by \var{delta}.
\end{opcodedesc}
+
+ %\begin{opcodedesc}{FOR_LOOP}{delta}
+ %This opcode is obsolete.
+ %\end{opcodedesc}
%\begin{opcodedesc}{LOAD_LOCAL}{namei}