Subclassing Python's dict

Xavier Ho contact at
Wed Aug 5 16:32:15 CEST 2009

On Thu, Aug 6, 2009 at 11:51 AM, Sergey Simonenko <gforgx at>wrote:

> I subclass builtin 'dict' in my application and experience some problems
> with it.

You should subclass collections.UserDict, and not the default dict class.
Refer to the collections module.

Also, the ABC MutableMapping might be of your interest.

> Another guy have reported me that he experiences similar problems with
> subclassing builtin 'list'.

Similarly, UserList is what you should subclass.


Ching-Yun "Xavier" Ho, Technical Artist

Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: contact at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list