[Python-checkins] CVS: python/dist/src/Doc/ref ref5.tex,1.41,1.42
Fred L. Drake
fdrake@users.sourceforge.net
Mon, 05 Mar 2001 23:32:13 -0800
Update of /cvsroot/python/python/dist/src/Doc/ref
In directory usw-pr-cvs1:/tmp/cvs-serv16492
Modified Files:
ref5.tex
Log Message:
Re-word the explanation of the in/not in operators for increased content
and clarity.
Add a footnote to the information on the possibility of shadowing builtins
with locals & module globals.
Index: ref5.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** ref5.tex 2001/01/14 02:57:14 1.41
--- ref5.tex 2001/03/06 07:32:11 1.42
***************
*** 66,70 ****
in the block, or when it is assigned to but also explicitly listed in
a \keyword{global} statement, it refers to a global name if one exists,
! else to a built-in name (and this binding may dynamically change).
\indexii{name}{binding}
\index{code block}
--- 66,75 ----
in the block, or when it is assigned to but also explicitly listed in
a \keyword{global} statement, it refers to a global name if one exists,
! else to a built-in name (and this binding may dynamically
! change).\footnote{The Python interpreter provides a useful set of
! predefined built-in functions. It is not recommended to reuse
! (hide) these names with self defined objects. See the
! \citetitle[../lib/built-in-funcs.html]{Python Library Reference} for
! the descriptions of built-in functions and methods.}
\indexii{name}{binding}
\index{code block}
***************
*** 758,768 ****
The operators \keyword{in} and \keyword{not in} test for set
! membership: every type can define membership in whatever way is
! appropriate. Traditionally, this interface has been tightly bound to
! the sequence interface, which is related in that presence in a sequence
! can be usefully interpreted as membership in a set.
For the list and tuple types, \code{\var{x} in \var{y}} is true if and
! only if there exists such an index \var{i} such that
\code{\var{x} == \var{y}[\var{i}]} is true.
--- 763,776 ----
The operators \keyword{in} and \keyword{not in} test for set
! membership. \code{\var{x} in \var{s}} evaluates to true if \var{x}
! is a member of the set \var{s}, and false otherwise. \code{\var{x}
! not in \var{s}} returns the negation of \code{\var{x} in \var{s}}.
! The set membership test has traditionally been bound to sequences; an
! object is a member of a set if the set is a sequence and contains an
! element equal to that object. However, it is possible for an object
! to support membership tests without being a sequence.
For the list and tuple types, \code{\var{x} in \var{y}} is true if and
! only if there exists an index \var{i} such that
\code{\var{x} == \var{y}[\var{i}]} is true.