Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > If a class X is in the MRO of call Y, then X is a superclass of Y. I > agree that the documentation for super is somewhat misleading (and > obviously wrong), but it still *give access to* (at least one of) > the superclass(es).
I believe the confusion comes from different assumptions about what "superclasses" refers to. super() iterates over superclasses of the *instance* in use, but an individual call to super does not necessarily invoke the superclass of the *implementation* of the method. For example, given a random class: class X(Y): def foo(self): super(X, self).foo() ...there is in fact no guarantee that super() calls a superclass of X. However, it is certainly guaranteed that it will call a superclass of type(self). Pre-2.2 Python used a simpler scheme where the superclass was always called, but it caused problems with diamond inheritance where some methods would be called either twice or not at all. (This is explained in http://www.python.org/download/releases/2.2.3/descrintro/ in some detail.) -- http://mail.python.org/mailman/listinfo/python-list