diff options
author | Raymond Hettinger <python@rcn.com> | 2005-01-04 21:25:00 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-01-04 21:25:00 (GMT) |
commit | 31043cd6d843347d888178d59b8e94f5c0774096 (patch) | |
tree | 008edfcbf562e9cb9ab64487c78c92970b4ddeab /Doc/lib/libuserdict.tex | |
parent | d61788b9ae76c38cac2df3a58c1cf3e9422986c6 (diff) | |
download | cpython-31043cd6d843347d888178d59b8e94f5c0774096.zip cpython-31043cd6d843347d888178d59b8e94f5c0774096.tar.gz cpython-31043cd6d843347d888178d59b8e94f5c0774096.tar.bz2 |
Clarify that DictMixin is still useful. Only the UserDict class was supplanted.
Diffstat (limited to 'Doc/lib/libuserdict.tex')
-rw-r--r-- | Doc/lib/libuserdict.tex | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Doc/lib/libuserdict.tex b/Doc/lib/libuserdict.tex index 89d7428..ef643cc 100644 --- a/Doc/lib/libuserdict.tex +++ b/Doc/lib/libuserdict.tex @@ -4,22 +4,20 @@ \declaremodule{standard}{UserDict} \modulesynopsis{Class wrapper for dictionary objects.} -\note{This module is available for backward compatibility only. If -you are writing code that does not need to work with versions of -Python earlier than Python 2.2, please consider subclassing directly -from the built-in \class{dict} type.} -This module defines a class that acts as a wrapper around -dictionary objects. It is a useful base class for -your own dictionary-like classes, which can inherit from -them and override existing methods or add new ones. In this way one -can add new behaviors to dictionaries. - -The module also defines a mixin defining all dictionary methods for -classes that already have a minimum mapping interface. This greatly -simplifies writing classes that need to be substitutable for +The module defines a mixin, \class{DictMixin}, defining all dictionary +methods for classes that already have a minimum mapping interface. This +greatly simplifies writing classes that need to be substitutable for dictionaries (such as the shelve module). +This also module defines a class, \class{UserDict}, that acts as a wrapper +around dictionary objects. The need for this class has been largely +supplanted by the ability to subclass directly from \class{dict} (a feature +that became available starting with Python version 2.2). Prior to the +introduction of \class{dict}, the \class{UserDict} class was used to +create dictionary-like sub-classes that obtained new behaviors by overriding +existing methods or adding new ones. + The \module{UserDict} module defines the \class{UserDict} class and \class{DictMixin}: |