[Python-checkins] python/dist/src/Doc/lib libdis.tex,1.38,1.39 libtraceback.tex,1.15,1.16
mwh@users.sourceforge.net
mwh@users.sourceforge.net
Thu, 15 Aug 2002 07:59:32 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv10908/Doc/lib
Modified Files:
libdis.tex libtraceback.tex
Log Message:
This is my patch
[ 587993 ] SET_LINENO killer
Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab.
Many sundry changes to document and adapt to this change.
Index: libdis.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdis.tex,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** libdis.tex 5 Aug 2002 23:33:54 -0000 1.38
--- libdis.tex 15 Aug 2002 14:58:59 -0000 1.39
***************
*** 24,38 ****
\begin{verbatim}
>>> dis.dis(myfunc)
! 0 SET_LINENO 1
!
! 3 SET_LINENO 2
! 6 LOAD_GLOBAL 0 (len)
! 9 LOAD_FAST 0 (alist)
! 12 CALL_FUNCTION 1
! 15 RETURN_VALUE
! 16 LOAD_CONST 0 (None)
! 19 RETURN_VALUE
\end{verbatim}
The \module{dis} module defines the following functions and constants:
--- 24,36 ----
\begin{verbatim}
>>> dis.dis(myfunc)
! 2 0 LOAD_GLOBAL 0 (len)
! 3 LOAD_FAST 0 (alist)
! 6 CALL_FUNCTION 1
! 9 RETURN_VALUE
! 10 RETURN_NONE
\end{verbatim}
+ (The ``2'' is a line number).
+
The \module{dis} module defines the following functions and constants:
***************
*** 57,60 ****
--- 55,59 ----
\begin{enumerate}
+ \item the line number, for the first instruction of each line
\item the current instruction, indicated as \samp{-->},
\item a labelled instruction, indicated with \samp{>\code{>}},
***************
*** 403,406 ****
--- 402,413 ----
\end{opcodedesc}
+ \begin{opcodedesc}{RETURN_NONE}{}
+ Returns \constant{None} to the caller of the function. This opcode is
+ generated as the last opcode of every function and only then, for
+ reasons to do with tracing support. See the comments in the function
+ \cfunction{maybe_call_line_trace} in \file{Python/ceval.c} for the
+ gory details. \versionadded{2.3}.
+ \end{opcodedesc}
+
\begin{opcodedesc}{YIELD_VALUE}{}
Pops \code{TOS} and yields it from a generator.
***************
*** 622,626 ****
\begin{opcodedesc}{SET_LINENO}{lineno}
! Sets the current line number to \var{lineno}.
\end{opcodedesc}
--- 629,633 ----
\begin{opcodedesc}{SET_LINENO}{lineno}
! This opcode is obsolete.
\end{opcodedesc}
Index: libtraceback.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtraceback.tex,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** libtraceback.tex 25 Jul 2002 21:11:23 -0000 1.15
--- libtraceback.tex 15 Aug 2002 14:59:00 -0000 1.16
***************
*** 119,126 ****
\begin{funcdesc}{tb_lineno}{tb}
This function returns the current line number set in the traceback
! object. This is normally the same as the \code{\var{tb}.tb_lineno}
! field of the object, but when optimization is used (the -O flag) this
! field is not updated correctly; this function calculates the correct
! value.
\end{funcdesc}
--- 119,126 ----
\begin{funcdesc}{tb_lineno}{tb}
This function returns the current line number set in the traceback
! object. This function was necessary because in versions of Python
! prior to 2.3 when the \programopt{O} flag was passed to Python the
! \code{\var{tb}.tb_lineno} was not updated correctly. This function
! has no use in versions past 2.3.
\end{funcdesc}