4 ms·
How Python's super() actually gets used: http://www.google.com/codesearch?as_q=super\(&as_lang=python http://www.google.com/codesearch?as_q=super\(&as_lang=py.
by rhettinger 16y ago
How Python's super() actually gets used:
http://www.google.com/codesearch?as_q=super\(&as_lang=python http://www.google.com/codesearch?as_q=super\(&as_lang=py...
- limmeau 16y agoAnd, while we're at it, multiple inheritance: http://www.google.com/codesearch?hl=de&lr=&q=class\s%2B\w%2B\s*\(\s*\w%2B\s*,+file:.*\.py http://www.google.com/codesearch?hl=de&lr=&q=class\s...
- ra 16y agoIndeed. super() is a hook / callback which permits a library to be used in ways not envisaged by the original author.
- masklinn 16y agoThis definitely is not correct. Though there are many who argue that classes should be designed for inheritance and that classes which are not should not be inheritable (I'll leave that to your own judgement), when classes are designed for inheritance you do need a way to call your superclass. And in Python's case, due to MI, you need a way to call your superclasses in a consistent and sensible order even though these superclasses are unaware of one another (one might be "normally" inheritable while the other is a mixin-type superclass for instance, or used to inject metaclass-based behaviors). This is, as far as I know, a perfectly valid use case and one which requires a `super`-type utility (though Python's own `super` isn't quite a flawless implementation of this).