How do I say "two classes up in the inheritance chain" in python?
bignose+hates-spam at benfinney.id.au
Tue Jan 27 10:07:26 CET 2009
Daniel Fetchinson <fetchinson at googlemail.com> 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 |
More information about the Python-list