[Python-checkins] CVS: python/dist/src/Doc/lib libuserdict.tex,1.17,1.18

Fred L. Drake python-dev@python.org
Tue, 10 Oct 2000 13:58:51 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv26065/lib

Modified Files:
	libuserdict.tex 
Log Message:

Note that the UserString/MutableString classes are far less efficient
than the built-in string types (suggested by Moshe Zadka
<moshez@math.huji.ac.il>).

Clarified what "can be converted to a string" means.

Fixed a few markup nits.


Index: libuserdict.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libuserdict.tex,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** libuserdict.tex	2000/10/06 20:04:48	1.17
--- libuserdict.tex	2000/10/10 20:58:48	1.18
***************
*** 93,113 ****
  \sectionauthor{Peter Funk}{pf@artcom-gmbh.de}
  
! This module defines a class that acts as a wrapper around
! string objects.  It is a useful base class for
! your own string-like classes, which can inherit from
! them and override existing methods or add new ones.  In this way one
! can add new behaviors to strings.
  
! The \module{UserString} module defines the \class{UserString} class:
  
  \begin{classdesc}{UserString}{\optional{sequence}}
! Return a class instance that simulates a string or a Unicode string object.
! The instance's content is kept in a regular string or Unicode string
! object, which is accessible via the
! \member{data} attribute of \class{UserString} instances.  The instance's
! contents are initially set to a copy of \var{sequence}.
! \var{sequence} can be either a regular Python string or Unicode string,
! an instance of \class{UserString} (or a subclass) or an arbitrary sequence
! which can be converted into a string.
  \end{classdesc}
  
--- 93,116 ----
  \sectionauthor{Peter Funk}{pf@artcom-gmbh.de}
  
! This module defines a class that acts as a wrapper around string
! objects.  It is a useful base class for your own string-like classes,
! which can inherit from them and override existing methods or add new
! ones.  In this way one can add new behaviors to strings.
  
! It should be noted that these classes are highly inefficient compared
! to real string or Unicode objects; this is especially the case for
! \class{MutableString}.
  
+ The \module{UserString} module defines the following classes:
+ 
  \begin{classdesc}{UserString}{\optional{sequence}}
! Return a class instance that simulates a string or a Unicode string
! object.  The instance's content is kept in a regular string or Unicode
! string object, which is accessible via the \member{data} attribute of
! \class{UserString} instances.  The instance's contents are initially
! set to a copy of \var{sequence}.  \var{sequence} can be either a
! regular Python string or Unicode string, an instance of
! \class{UserString} (or a subclass) or an arbitrary sequence which can
! be converted into a string using the built-in \function{str()} function.
  \end{classdesc}
  
***************
*** 118,129 ****
  keys.  The main intention of this class is to serve as an educational
  example for inheritance and necessity to remove (override) the
! \function{__hash__} method in order to trap attempts to use a
  mutable object as dictionary key, which would be otherwise very
  error prone and hard to track down.
  \end{classdesc}
  
! In addition to supporting the methods and operations of string  or
! Unicode objects (see section \ref{typesseq}), \class{UserString} instances
! provide the following attribute:
  
  \begin{memberdesc}{data}
--- 121,133 ----
  keys.  The main intention of this class is to serve as an educational
  example for inheritance and necessity to remove (override) the
! \method{__hash__()} method in order to trap attempts to use a
  mutable object as dictionary key, which would be otherwise very
  error prone and hard to track down.
  \end{classdesc}
  
! In addition to supporting the methods and operations of string and
! Unicode objects (see section \ref{string-methods}, ``String
! Methods''), \class{UserString} instances provide the following
! attribute:
  
  \begin{memberdesc}{data}