[Python-Dev] python and super (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Apr 16 01:38:36 CEST 2011


Michael Foord wrote:

consider the "recently" introduced problem caused by object.init not taking arguments. This makes it impossible to use super correctly in various circumstances.

...

It is impossible to inherit from both C and A and have all parent init methods called correctly. Changing the semantics of super as described would fix this problem.

I don't see how, because auto-super-calling would eventually end up trying to call object.init with arguments and fail.

You might think to "fix" this by making a special case of object.init and refraining from calling it. But the same problem arises in a more general way whenever some class in the mix has a method with the right name but the wrong signature, which is likely to happen if you try to mix classes that weren't designed to be mixed together.

-- Greg



More information about the Python-Dev mailing list