Problem subclassing tuple

Skip Montanaro skip at pobox.com
Tue Apr 29 15:45:07 EDT 2003


    >> You might want to make it "cooperative", that is, instead of using
    >> "tuple.__new__", use "super(Holder,cls).__new__"

    >> This delegates the search for the superclass to the function super();
    >> and that gives you the ability to have multiple inheritance, since
    >> super() will "do the right thing" when getting your current class'
    >> superclass; so every class which defines a __new__ method has it
    >> called.

I don't believe it matters here.  As I recall, builtins don't support
multiple inheritance very well (if at all).  The most you can do is add
mixin classes.

Skip





More information about the Python-list mailing list