Movatterモバイル変換


[0]ホーム

URL:


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:3.6 typesUp:3. Python Runtime ServicesNext:3.8 UserList

3.7UserDict -- Class wrapper for dictionary objects

Note:This module is available for backward compatibility only. Ifyou are writing code that does not need to work with versions ofPython earlier than Python 2.2, please consider subclassing directlyfrom the built-indict type.

This module defines a class that acts as a wrapper arounddictionary objects. It is a useful base class foryour own dictionary-like classes, which can inherit fromthem and override existing methods or add new ones. In this way onecan add new behaviors to dictionaries.

TheUserDict module defines theUserDict class:

classUserDict([initialdata])
Class that simulates a dictionary. The instance'scontents are kept in a regular dictionary, which is accessible via thedata attribute ofUserDict instances. Ifinitialdata is provided,data is initialized with itscontents; note that a reference toinitialdata will not be kept, allowing it be used used for other purposes.

In addition to supporting the methods and operations of mappings (seesection2.2.7),UserDict instances provide thefollowing attribute:

data
A real dictionary used to store the contents of theUserDictclass.


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:3.6 typesUp:3. Python Runtime ServicesNext:3.8 UserList
Release 2.2.3, documentation updated on 30 May 2003.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2026 Movatter.jp