[Python-checkins] python/dist/src/Doc/lib libsets.tex,1.10,1.11

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Thu, 13 Feb 2003 19:42:13 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv16656/Doc/lib

Modified Files:
	libsets.tex 
Log Message:
SF bug #663701:  sets module review

Renamed hook methods to use the double underscore convention.


Index: libsets.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsets.tex,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** libsets.tex	14 Feb 2003 01:49:09 -0000	1.10
--- libsets.tex	14 Feb 2003 03:42:11 -0000	1.11
***************
*** 204,210 ****
  The mechanism is to always add a hashable element, or if it is not
  hashable, the element is checked to see if it has an
! \method{_as_immutable()} method which returns an immutable equivalent.
  
! Since \class{Set} objects have a \method{_as_immutable()} method
  returning an instance of \class{ImmutableSet}, it is possible to
  construct sets of sets.
--- 204,210 ----
  The mechanism is to always add a hashable element, or if it is not
  hashable, the element is checked to see if it has an
! \method{__as_immutable__()} method which returns an immutable equivalent.
  
! Since \class{Set} objects have a \method{__as_immutable__()} method
  returning an instance of \class{ImmutableSet}, it is possible to
  construct sets of sets.
***************
*** 213,217 ****
  \method{remove()} methods which need to hash an element to check
  for membership in a set.  Those methods check an element for hashability
! and, if not, check for a \method{_as_temporarily_immutable()} method
  which returns the element wrapped by a class that provides temporary
  methods for \method{__hash__()}, \method{__eq__()}, and \method{__ne__()}.
--- 213,217 ----
  \method{remove()} methods which need to hash an element to check
  for membership in a set.  Those methods check an element for hashability
! and, if not, check for a \method{__as_temporarily_immutable__()} method
  which returns the element wrapped by a class that provides temporary
  methods for \method{__hash__()}, \method{__eq__()}, and \method{__ne__()}.
***************
*** 220,224 ****
  the original mutable object.
  
! \class{Set} objects implement the \method{_as_temporarily_immutable()}
  method which returns the \class{Set} object wrapped by a new class
  \class{_TemporarilyImmutableSet}.
--- 220,224 ----
  the original mutable object.
  
! \class{Set} objects implement the \method{__as_temporarily_immutable__()}
  method which returns the \class{Set} object wrapped by a new class
  \class{_TemporarilyImmutableSet}.