UserDict, UserList, and UserString

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 ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.