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