[Python-checkins] CVS: python/dist/src/Doc/lib libinspect.tex,1.1,1.2
Fred L. Drake
fdrake@users.sourceforge.net
Wed, 28 Feb 2001 15:01:40 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7973
Modified Files:
libinspect.tex
Log Message:
Clean up some of the markup for consistency, wrap some long lines.
Index: libinspect.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** libinspect.tex 2001/02/27 14:43:21 1.1
--- libinspect.tex 2001/02/28 23:01:38 1.2
***************
*** 1,11 ****
\section{\module{inspect} ---
Inspect live objects}
\declaremodule{standard}{inspect}
\modulesynopsis{Extract information and source code from live objects.}
! \index{inspect}
\versionadded{2.1}
! The \code{inspect} module provides several useful functions
to help get information about live objects such as modules,
classes, methods, functions, tracebacks, frame objects, and
--- 1,13 ----
\section{\module{inspect} ---
Inspect live objects}
+
\declaremodule{standard}{inspect}
\modulesynopsis{Extract information and source code from live objects.}
! \moduleauthor{Ka-Ping Yee}{ping@lfw.org}
! \sectionauthor{Ka-Ping Yee}{ping@lfw.org}
\versionadded{2.1}
! The \module{inspect} module provides several useful functions
to help get information about live objects such as modules,
classes, methods, functions, tracebacks, frame objects, and
***************
*** 32,41 ****
\lineiii{module}{__doc__}{documentation string}
\lineiii{}{__file__}{filename (missing for built-in modules)}
! \lineiii{}{}{}
!
\lineiii{class}{__doc__}{documentation string}
\lineiii{}{__module__}{name of module in which this class was defined}
! \lineiii{}{}{}
!
\lineiii{method}{__doc__}{documentation string}
\lineiii{}{__name__}{name with which this method was defined}
--- 34,41 ----
\lineiii{module}{__doc__}{documentation string}
\lineiii{}{__file__}{filename (missing for built-in modules)}
! \hline
\lineiii{class}{__doc__}{documentation string}
\lineiii{}{__module__}{name of module in which this class was defined}
! \hline
\lineiii{method}{__doc__}{documentation string}
\lineiii{}{__name__}{name with which this method was defined}
***************
*** 43,48 ****
\lineiii{}{im_func}{function object containing implementation of method}
\lineiii{}{im_self}{instance to which this method is bound, or \code{None}}
! \lineiii{}{}{}
!
\lineiii{function}{__doc__}{documentation string}
\lineiii{}{__name__}{name with which this function was defined}
--- 43,47 ----
\lineiii{}{im_func}{function object containing implementation of method}
\lineiii{}{im_self}{instance to which this method is bound, or \code{None}}
! \hline
\lineiii{function}{__doc__}{documentation string}
\lineiii{}{__name__}{name with which this function was defined}
***************
*** 52,63 ****
\lineiii{}{func_globals}{global namespace in which this function was defined}
\lineiii{}{func_name}{(same as __name__)}
! \lineiii{}{}{}
!
\lineiii{traceback}{tb_frame}{frame object at this level}
\lineiii{}{tb_lasti}{index of last attempted instruction in bytecode}
\lineiii{}{tb_lineno}{current line number in Python source code}
\lineiii{}{tb_next}{next inner traceback object (called by this level)}
! \lineiii{}{}{}
!
\lineiii{frame}{f_back}{next outer frame object (this frame's caller)}
\lineiii{}{f_builtins}{built-in namespace seen by this frame}
--- 51,60 ----
\lineiii{}{func_globals}{global namespace in which this function was defined}
\lineiii{}{func_name}{(same as __name__)}
! \hline
\lineiii{traceback}{tb_frame}{frame object at this level}
\lineiii{}{tb_lasti}{index of last attempted instruction in bytecode}
\lineiii{}{tb_lineno}{current line number in Python source code}
\lineiii{}{tb_next}{next inner traceback object (called by this level)}
! \hline
\lineiii{frame}{f_back}{next outer frame object (this frame's caller)}
\lineiii{}{f_builtins}{built-in namespace seen by this frame}
***************
*** 72,77 ****
\lineiii{}{f_restricted}{0 or 1 if frame is in restricted execution mode}
\lineiii{}{f_trace}{tracing function for this frame, or \code{None}}
! \lineiii{}{}{}
!
\lineiii{code}{co_argcount}{number of arguments (not including * or ** args)}
\lineiii{}{co_code}{string of raw compiled bytecode}
--- 69,73 ----
\lineiii{}{f_restricted}{0 or 1 if frame is in restricted execution mode}
\lineiii{}{f_trace}{tracing function for this frame, or \code{None}}
! \hline
\lineiii{code}{co_argcount}{number of arguments (not including * or ** args)}
\lineiii{}{co_code}{string of raw compiled bytecode}
***************
*** 86,91 ****
\lineiii{}{co_stacksize}{virtual machine stack space required}
\lineiii{}{co_varnames}{tuple of names of arguments and local variables}
! \lineiii{}{}{}
!
\lineiii{builtin}{__doc__}{documentation string}
\lineiii{}{__name__}{original name of this function or method}
--- 82,86 ----
\lineiii{}{co_stacksize}{virtual machine stack space required}
\lineiii{}{co_varnames}{tuple of names of arguments and local variables}
! \hline
\lineiii{builtin}{__doc__}{documentation string}
\lineiii{}{__name__}{original name of this function or method}
***************
*** 152,158 ****
\begin{funcdesc}{getfile}{object}
! Return the name of the (text or binary) file in which an object was defined.
! This will fail with a TypeError if the object is a built-in module,
! class, or function.
\end{funcdesc}
--- 147,153 ----
\begin{funcdesc}{getfile}{object}
! Return the name of the (text or binary) file in which an object was
! defined. This will fail with a \exception{TypeError} if the object
! is a built-in module, class, or function.
\end{funcdesc}
***************
*** 162,168 ****
\begin{funcdesc}{getsourcefile}{object}
! Return the name of the Python source file in which an object was defined.
! This will fail with a TypeError if the object is a built-in module,
! class, or function.
\end{funcdesc}
--- 157,163 ----
\begin{funcdesc}{getsourcefile}{object}
! Return the name of the Python source file in which an object was
! defined. This will fail with a \exception{TypeError} if the object
! is a built-in module, class, or function.
\end{funcdesc}
***************
*** 172,177 ****
or code object. The source code is returned as a list of the lines
corresponding to the object and the line number indicates where in the
! original source file the first line of code was found. An IOError is
! raised if the source code cannot be retrieved.
\end{funcdesc}
--- 167,172 ----
or code object. The source code is returned as a list of the lines
corresponding to the object and the line number indicates where in the
! original source file the first line of code was found. An
! \exception{IOError} is raised if the source code cannot be retrieved.
\end{funcdesc}
***************
*** 180,184 ****
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a single string. An
! IOError is raised if the source code cannot be retrieved.
\end{funcdesc}
--- 175,179 ----
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a single string. An
! \exception{IOError} is raised if the source code cannot be retrieved.
\end{funcdesc}
***************
*** 198,205 ****
\begin{funcdesc}{getargspec}{func}
Get the names and default values of a function's arguments.
! A tuple of four things is returned: (args, varargs, varkw, defaults).
\var{args} is a list of the argument names (it may contain nested lists).
! \var{varargs} and \var{varkw} are the names of the * and ** arguments or
! \code{None}.
\var{defaults} is a tuple of default argument values; if this tuple
has \var{n} elements, they correspond to the last \var{n} elements
--- 193,201 ----
\begin{funcdesc}{getargspec}{func}
Get the names and default values of a function's arguments.
! A tuple of four things is returned: \code{(\var{args},
! \var{varargs}, \var{varkw}, \var{defaults})}.
\var{args} is a list of the argument names (it may contain nested lists).
! \var{varargs} and \var{varkw} are the names of the \code{*} and
! \code{**} arguments or \code{None}.
\var{defaults} is a tuple of default argument values; if this tuple
has \var{n} elements, they correspond to the last \var{n} elements
***************
*** 209,231 ****
\begin{funcdesc}{getargvalues}{frame}
Get information about arguments passed into a particular frame.
! A tuple of four things is returned: (args, varargs, varkw, locals).
! \var{args} is a list of the argument names (it may contain nested lists).
! \var{varargs} and \var{varkw} are the names of the * and ** arguments or
! \code{None}.
\var{locals} is the locals dictionary of the given frame.
\end{funcdesc}
\begin{funcdesc}{formatargspec}{args\optional{, varargs, varkw, defaults,
! argformat, varargsformat, varkwformat, defaultformat}}
! Format a pretty argument spec from the four values returned by getargspec.
! The other four arguments are the corresponding optional formatting functions
! that are called to turn names and values into strings.
\end{funcdesc}
\begin{funcdesc}{formatargvalues}{args\optional{, varargs, varkw, locals,
! argformat, varargsformat, varkwformat, valueformat}}
! Format a pretty argument spec from the four values returned by getargvalues.
! The other four arguments are the corresponding optional formatting functions
! that are called to turn names and values into strings.
\end{funcdesc}
--- 205,232 ----
\begin{funcdesc}{getargvalues}{frame}
Get information about arguments passed into a particular frame.
! A tuple of four things is returned: \code{(\var{args},
! \var{varargs}, \var{varkw}, \var{locals})}.
! \var{args} is a list of the argument names (it may contain nested
! lists).
! \var{varargs} and \var{varkw} are the names of the \code{*} and
! \code{**} arguments or \code{None}.
\var{locals} is the locals dictionary of the given frame.
\end{funcdesc}
\begin{funcdesc}{formatargspec}{args\optional{, varargs, varkw, defaults,
! argformat, varargsformat, varkwformat, defaultformat}}
!
! Format a pretty argument spec from the four values returned by
! \function{getargspec()}. The other four arguments are the
! corresponding optional formatting functions that are called to turn
! names and values into strings.
\end{funcdesc}
\begin{funcdesc}{formatargvalues}{args\optional{, varargs, varkw, locals,
! argformat, varargsformat, varkwformat, valueformat}}
! Format a pretty argument spec from the four values returned by
! \function{getargvalues()}. The other four arguments are the
! corresponding optional formatting functions that are called to turn
! names and values into strings.
\end{funcdesc}
***************
*** 233,237 ****
\label{inspect-stack}}
! When the following functions return ``frame records'', each record
is a tuple of six items: the frame object, the filename,
the line number of the current line, the function name, a list of
--- 234,238 ----
\label{inspect-stack}}
! When the following functions return ``frame records,'' each record
is a tuple of six items: the frame object, the filename,
the line number of the current line, the function name, a list of
***************
*** 242,250 ****
\begin{funcdesc}{getouterframes}{frame\optional{, context}}
! Get a list of frame records for a frame and all higher (calling) frames.
\end{funcdesc}
\begin{funcdesc}{getinnerframes}{traceback\optional{, context}}
! Get a list of frame records for a traceback's frame and all lower frames.
\end{funcdesc}
--- 243,253 ----
\begin{funcdesc}{getouterframes}{frame\optional{, context}}
! Get a list of frame records for a frame and all higher (calling)
! frames.
\end{funcdesc}
\begin{funcdesc}{getinnerframes}{traceback\optional{, context}}
! Get a list of frame records for a traceback's frame and all lower
! frames.
\end{funcdesc}
***************
*** 254,261 ****
\begin{funcdesc}{stack}{\optional{context}}
! Return a list of frame records for the stack above the caller's frame.
\end{funcdesc}
\begin{funcdesc}{trace}{\optional{context}}
! Return a list of frame records for the stack below the current exception.
\end{funcdesc}
--- 257,266 ----
\begin{funcdesc}{stack}{\optional{context}}
! Return a list of frame records for the stack above the caller's
! frame.
\end{funcdesc}
\begin{funcdesc}{trace}{\optional{context}}
! Return a list of frame records for the stack below the current
! exception.
\end{funcdesc}