Subclassing Python's dict

alex23 wuwei23 at
Thu Aug 6 05:19:37 CEST 2009

Xavier Ho wrote:
> You should subclass collections.UserDict, and not the default dict class.
> Refer to the collections module.

Xavier, why do you think that is the correct approach? The docs say
"The need for this class has been largely supplanted by the ability to
subclass directly from dict (a feature that became available starting
with Python version 2.2)."

If you mean that Sergey should subclass _in this instance_ could you
please explain why? (Sorry if you already have, I never saw your
original post...)

More information about the Python-list mailing list