Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6243e4

Browse files
committed
Add notes on the requirements for subclasses.
This closes SourceForge bug #115928.
1 parent 2e06c20 commit c6243e4

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Doc/lib/libuserdict.tex

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,25 @@ \section{\module{UserList} ---
6464
\class{UserList} class.
6565
\end{memberdesc}
6666

67+
\strong{Subclassing requirements:}
68+
Subclasses of \class{UserList} are expect to offer a constructor which
69+
can be called with either no arguments or one argument. List
70+
operations which return a new sequence attempt to create an instance
71+
of the actual implementation class. To do so, it assumes that the
72+
constructor can be called with a single parameter, which is a sequence
73+
object used as a data source.
74+
75+
If a derived class does not wish to comply with this requirement, all
76+
of the special methods supported by this class will need to be
77+
overridden; please consult the sources for information about the
78+
methods which need to be provided in that case.
79+
80+
\versionchanged[Python versions 1.5.2 and 1.6 also required that the
81+
constructor be callable with no parameters, and offer
82+
a mutable \member{data} attribute. Earlier versions
83+
of Python did not attempt to create instances of the
84+
derived class]{2.0}
85+
6786

6887
\section{\module{UserString} ---
6988
Class wrapper for string objects}

0 commit comments

Comments
 (0)