How do I say "two classes up in the inheritance chain" in python?

Ben Finney bignose+hates-spam at
Tue Jan 27 10:07:26 CET 2009

Daniel Fetchinson <fetchinson at> writes:

> The meth methods in child1 and child2 are the same, except that in
> the last super call, one is referring to parent1, the other is
> referring to parent2.

It's important to learn that, in a language with multiple inheritance,
“superclass of this instance” is *not* the same concept as “parent
of this class”. The class you're coding may end up at any arbitrary
point in a resolution chain, despite what the class inherits from.

It's also important to be aware of the hairiness of Python's ‘super’

 \        “No matter how cynical you become, it's never enough to keep |
  `\                                up.” —Jane Wagner, via Lily Tomlin |
_o__)                                                                  |
Ben Finney

More information about the Python-list mailing list