O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required