diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-23 17:23:50 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-23 17:23:50 (GMT) |
commit | aa90adcfb9ed2d5bed743e18e83489930296bd25 (patch) | |
tree | d575195b2cf177bdadef96a5890617f5aeef8747 /Doc/lib | |
parent | 7190247e0b43b5193a00239b209334aa34e70217 (diff) | |
download | cpython-aa90adcfb9ed2d5bed743e18e83489930296bd25.zip cpython-aa90adcfb9ed2d5bed743e18e83489930296bd25.tar.gz cpython-aa90adcfb9ed2d5bed743e18e83489930296bd25.tar.bz2 |
Add nested scopes spec to appendix.
Add new opcodes LOAD_CLOSURE, LOAD_DEREF, STORE_DEREF, MAKE_CLOSURE to
docs for dis module.
Add docs for new function and code members in Sec. 3 of ref manual.
They're present regardless of whether nested scopes are used.
Remove description of default argument hack from Sec. 7 of the ref
manual and refer the reader to the appendix.
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libdis.tex | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Doc/lib/libdis.tex b/Doc/lib/libdis.tex index 7fc831a..3a274ef 100644 --- a/Doc/lib/libdis.tex +++ b/Doc/lib/libdis.tex @@ -556,6 +556,25 @@ Stores TOS into the local \code{co_varnames[\var{var_num}]}. Deletes local \code{co_varnames[\var{var_num}]}. \end{opcodedesc} +\begin{opcodedesc}{LOAD_CLOSURE}{i} +Pushes a reference to the cell contained in slot \var{i} of the +cell and free variable storage. The name of the variable is +\code{co_cellvars[\var{i}]} if \var{i} is less than the length of +\var{co_cellvars}. Otherwise it is +\code{co_freevars[\var{i} - len(co_cellvars)]}. +\end{opcodedesc} + +\begin{opcodedesc}{LOAD_DEREF}{i} +Loads the cell contained in slot \var{i} of the cell and free variable +storage. Pushes a reference to the object the cell contains on the +stack. +\end{opcodedesc} + +\begin{opcodedesc}{STORE_DEREF}{i} +Stores TOS into the cell contained in slot \var{i} of the cell and +free variable storage. +\end{opcodedesc} + \begin{opcodedesc}{SET_LINENO}{lineno} Sets the current line number to \var{lineno}. \end{opcodedesc} @@ -583,6 +602,14 @@ with the function. The function object is defined to have \var{argc} default parameters, which are found below TOS. \end{opcodedesc} +\begin{opcodedesc}{MAKE_CLOSURE}{argc} +Creates a new function object, sets its \var{func_closure} slot, and +pushes it on the stack. TOS is the code associated with the function. +If the code object has N free variables, the next N items on the stack +are the cells for these variables. The function also has \var{argc} +default parameters, where are found before the cells. +\end{opcodedesc} + \begin{opcodedesc}{BUILD_SLICE}{argc} Pushes a slice object on the stack. \var{argc} must be 2 or 3. If it is 2, \code{slice(TOS1, TOS)} is pushed; if it is 3, |