[Python-checkins] CVS: python/dist/src/Doc/ref ref3.tex,1.52,1.53

Fred L. Drake python-dev@python.org
Wed, 6 Dec 2000 20:49:36 -0800

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

Modified Files:
Log Message:

Added a note that objects which emulate built-in types should only
implement as many of the relevant methods as make sense for the particular
information being modelled.

Index: ref3.tex
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -r1.52 -r1.53
*** ref3.tex	2000/09/21 22:27:16	1.52
--- ref3.tex	2000/12/07 04:49:34	1.53
*** 842,845 ****
--- 842,852 ----
  \withsubitem{(mapping object method)}{\ttindex{__getitem__()}}
+ When implementing a class that emulates any built-in type, it is
+ important that the emulation only be implemented to the degree that it
+ makes sense for the object being modelled.  For example, some
+ sequences may work well with retrieval of individual elements, but
+ extracting a slice may not make sense.  (One example of this is the
+ \class{NodeList} interface in the W3C's Document Object Model.)
  \subsection{Basic customization\label{customization}}