How to remember the order of arguments to super() in Python2(danverbraganza.com)
danverbraganza.com
How to remember the order of arguments to super() in Python2
http://danverbraganza.com/writings/python2-super-arguments-mnemonic
1 comments
I most often run into using super() with __init__(). This makes the problem with calling super from a specific superclass very obvious. Every class along the hierarchy needs to ensure that it's __init__() gets called (or you end up with a Franken-object that hasn't been properly initialized).
I can't remember a time when I've had a class that multiply inherits and I want to change which superclass overrides on a per-method basis (i.e. given class A(B, C), some method A.foo() should call B.foo() and some method A.bar() should call C.bar(), although both B and C can both bar() and foo()). However, I grant that that _could_ happen. I don't have a solution right now that's better than explicitly referring to the unbound method of the subclass to whose implementation you want to refer.
I can't remember a time when I've had a class that multiply inherits and I want to change which superclass overrides on a per-method basis (i.e. given class A(B, C), some method A.foo() should call B.foo() and some method A.bar() should call C.bar(), although both B and C can both bar() and foo()). However, I grant that that _could_ happen. I don't have a solution right now that's better than explicitly referring to the unbound method of the subclass to whose implementation you want to refer.
ive always believed that you should be able to target a specific base class with the super statement..