Question: Inheritance from a buil-in type

T. Kaufmann merman at snafu.de
Mon Sep 29 16:59:18 CEST 2003


Hi there,

A simple but important question:

How can I initialize a super class (like dict) correctly in my subclass constructor?

A sample:

class MyClass(dict):
     def __init__(self):
         dict.__init__(self)
         ...


Is there a general rule to do this for all buil-in types?

Thanks for help.

Thomas






More information about the Python-list mailing list