blob: 6c29906fc34c5347880f906e262d2fcf6fb22c1c [file] [log] [blame]
Fred Drake1ce36041998-04-07 20:05:33 +00001\section{Standard Module \module{UserDict}}
Fred Drakeb91e9341998-07-23 17:59:49 +00002\declaremodule{standard}{UserDict}
3
4\modulesynopsis{Class wrapper for dictionary objects.}
5
Fred Drakefcda5601998-01-07 22:05:25 +00006
Fred Drake1ce36041998-04-07 20:05:33 +00007This module defines a class that acts as a wrapper around
8dictionary objects. It is a useful base class for
9your own dictionary-like classes, which can inherit from
Guido van Rossum7f3b0421997-03-27 14:56:18 +000010them and override existing methods or add new ones. In this way one
Fred Drake1ce36041998-04-07 20:05:33 +000011can add new behaviours to dictionaries.
Guido van Rossum7f3b0421997-03-27 14:56:18 +000012
Fred Drake802a2021998-02-19 06:26:35 +000013The \module{UserDict} module defines the \class{UserDict} class:
Guido van Rossum7f3b0421997-03-27 14:56:18 +000014
Fred Drake802a2021998-02-19 06:26:35 +000015\begin{classdesc}{UserDict}{}
Guido van Rossum7f3b0421997-03-27 14:56:18 +000016Return a class instance that simulates a dictionary. The instance's
17contents are kept in a regular dictionary, which is accessible via the
Fred Drake802a2021998-02-19 06:26:35 +000018\member{data} attribute of \class{UserDict} instances.
19\end{classdesc}
Guido van Rossum7f3b0421997-03-27 14:56:18 +000020
Fred Drake1ce36041998-04-07 20:05:33 +000021\begin{memberdesc}{data}
22A real dictionary used to store the contents of the \class{UserDict}
23class.
24\end{memberdesc}
25
26
27\section{Standard Module \module{UserList}}
Fred Drakeb91e9341998-07-23 17:59:49 +000028\declaremodule{standard}{UserList}
29
30\modulesynopsis{Class wrapper for list objects.}
31
Fred Drake1ce36041998-04-07 20:05:33 +000032
33This module defines a class that acts as a wrapper around
34list objects. It is a useful base class for
35your own list-like classes, which can inherit from
36them and override existing methods or add new ones. In this way one
37can add new behaviours to lists.
38
Fred Drake802a2021998-02-19 06:26:35 +000039The \module{UserList} module defines the \class{UserList} class:
Guido van Rossum7f3b0421997-03-27 14:56:18 +000040
Fred Drake802a2021998-02-19 06:26:35 +000041\begin{classdesc}{UserList}{\optional{list}}
Guido van Rossum7f3b0421997-03-27 14:56:18 +000042Return a class instance that simulates a list. The instance's
43contents are kept in a regular list, which is accessible via the
Fred Drake802a2021998-02-19 06:26:35 +000044\member{data} attribute of \class{UserList} instances. The instance's
Fred Drakefcda5601998-01-07 22:05:25 +000045contents are initially set to a copy of \var{list}, defaulting to the
Guido van Rossum7f3b0421997-03-27 14:56:18 +000046empty list \code{[]}. \var{list} can be either a regular Python list,
Fred Drake802a2021998-02-19 06:26:35 +000047or an instance of \class{UserList} (or a subclass).
48\end{classdesc}
Fred Drake1ce36041998-04-07 20:05:33 +000049
50\begin{memberdesc}{data}
51A real Python list object used to store the contents of the
52\class{UserList} class.
53\end{memberdesc}