February 2006
Intermediate to advanced
648 pages
14h 53m
English
The UserDict, UserList, and UserString modules provide classes that implement wrappers around the built-in dictionary, list, and string objects, respectively. Historically, these wrappers were used as base classes for classes that wanted to override or add new methods to these types. Because modern versions of Python allow built-in types to be subclassed directly, use of this module is rarely needed. However, you may see this module in use in older Python code. Each module defines the class UserDict, UserList, and UserString, respectively.
UserDict([initialdata])Returns a class instance that simulates a dictionary. initialdata is an optional dictionary whose contents are used to populate the newly created ...