[Python-checkins] CVS: python/dist/src/Doc/ref ref3.tex,1.83,1.84
Jeremy Hylton
jhylton@users.sourceforge.net
Mon, 01 Apr 2002 10:53:38 -0800
Update of /cvsroot/python/python/dist/src/Doc/ref
In directory usw-pr-cvs1:/tmp/cvs-serv2515
Modified Files:
ref3.tex
Log Message:
Update documentation of code objects.
Split the description of co_flags into two paragraphs. The first
describes the flags that are used for non-future purposes, where
CO_GENERATOR was added. The second describes __future__'s use of
co_flags and mentions the only one currently meaningful,
CO_FUTURE_DIVISION.
Index: ref3.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** ref3.tex 1 Apr 2002 17:58:39 -0000 1.83
--- ref3.tex 1 Apr 2002 18:53:36 -0000 1.84
***************
*** 731,736 ****
a tuple containing the names of local variables that are referenced by
nested functions; \member{co_freevars} is a tuple containing the names
! of local variables that are neither local nor global; \member{co_code}
! is a string representing the sequence of bytecode instructions;
\member{co_consts} is a tuple containing the literals used by the
bytecode; \member{co_names} is a tuple containing the names used by
--- 731,736 ----
a tuple containing the names of local variables that are referenced by
nested functions; \member{co_freevars} is a tuple containing the names
! of free variables; \member{co_code} is a string representing the
! sequence of bytecode instructions;
\member{co_consts} is a tuple containing the literals used by the
bytecode; \member{co_names} is a tuple containing the names used by
***************
*** 743,750 ****
a number of flags for the interpreter.
- The \member{co_cellvars} and \member{co_freevars} are present in
- Python 2.1 when nested scopes are not enabled, but the code itself
- does not use or create cells.
-
\withsubitem{(code object attribute)}{
\ttindex{co_argcount}
--- 743,746 ----
***************
*** 767,774 ****
to accept an arbitrary number of positional arguments; bit
\code{0x08} is set if the function uses the \samp{**keywords} syntax
! to accept arbitrary keyword arguments; other bits are used internally
! or reserved for future use; bit \code{0x10} is set if the function was
! compiled with nested scopes enabled. If\index{documentation string} a
! code object represents a function, the first item in
\member{co_consts} is the documentation string of the function, or
\code{None} if undefined.
--- 763,779 ----
to accept an arbitrary number of positional arguments; bit
\code{0x08} is set if the function uses the \samp{**keywords} syntax
! to accept arbitrary keyword arguments; bit \code{0x20} is set if the
! function is a \obindex{generator}.
!
! Future feature declarations (\samp{from __future__ import division})
! also use bits in \member{co_flags} to indicate whether a code object
! was compiled with a particular feature enabled: bit \code{0x2000} is
! set if the function was compiled with future division enabled; bits
! \code{0x10} and \code{0x1000} were used in earlier versions of Python.
!
! Other bits in \member{co_flags} are reserved for internal use.
!
! If\index{documentation string} a code object represents a function,
! the first item in
\member{co_consts} is the documentation string of the function, or
\code{None} if undefined.