summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libuserdict.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-10-06 20:04:48 (GMT)
committerFred Drake <fdrake@acm.org>2000-10-06 20:04:48 (GMT)
commitc6243e4e08f8103992a136c3996ea2bea89bab50 (patch)
treea91b7950d577e7c03ee09cc9776a11855a4db6aa /Doc/lib/libuserdict.tex
parent2e06c209dcdc7c7460ee06c1601a751bda84f82a (diff)
downloadcpython-c6243e4e08f8103992a136c3996ea2bea89bab50.zip
cpython-c6243e4e08f8103992a136c3996ea2bea89bab50.tar.gz
cpython-c6243e4e08f8103992a136c3996ea2bea89bab50.tar.bz2
Add notes on the requirements for subclasses.
This closes SourceForge bug #115928.
Diffstat (limited to 'Doc/lib/libuserdict.tex')
-rw-r--r--Doc/lib/libuserdict.tex19
1 files changed, 19 insertions, 0 deletions
diff --git a/Doc/lib/libuserdict.tex b/Doc/lib/libuserdict.tex
index a27755a..62aff77 100644
--- a/Doc/lib/libuserdict.tex
+++ b/Doc/lib/libuserdict.tex
@@ -64,6 +64,25 @@ A real Python list object used to store the contents of the
\class{UserList} class.
\end{memberdesc}
+\strong{Subclassing requirements:}
+Subclasses of \class{UserList} are expect to offer a constructor which
+can be called with either no arguments or one argument. List
+operations which return a new sequence attempt to create an instance
+of the actual implementation class. To do so, it assumes that the
+constructor can be called with a single parameter, which is a sequence
+object used as a data source.
+
+If a derived class does not wish to comply with this requirement, all
+of the special methods supported by this class will need to be
+overridden; please consult the sources for information about the
+methods which need to be provided in that case.
+
+\versionchanged[Python versions 1.5.2 and 1.6 also required that the
+ constructor be callable with no parameters, and offer
+ a mutable \member{data} attribute. Earlier versions
+ of Python did not attempt to create instances of the
+ derived class]{2.0}
+
\section{\module{UserString} ---
Class wrapper for string objects}