GNU Info

Info Node: (python2.1-lib.info)UserDict

(python2.1-lib.info)UserDict


Next: UserList Prev: types Up: Python Runtime Services
Enter node , (file) or (file)node

Class wrapper for dictionary objects
====================================

Class wrapper for dictionary objects.

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 `UserDict' module defines the `UserDict' class:

`UserDict([initialdata])'
     Class that simulates a dictionary.  The instance's contents are
     kept in a regular dictionary, which is accessible via the `data'
     attribute of `UserDict' instances.  If INITIALDATA is provided,
     `data' is initialized with its contents; note that a reference to
     INITIALDATA will not be kept, allowing it be used used for other
     purposes.

In addition to supporting the methods and operations of mappings (see
section Note: Mapping Types), `UserDict' instances provide the
following attribute:

`data'
     A real dictionary used to store the contents of the `UserDict'
     class.


automatically generated by info2www version 1.2.2.9