OOP: method overriding works in mysterious ways?

Dustan DustanGroups at gmail.com
Mon Jan 2 15:42:35 EST 2006


Oh, I see what you mean. From my experience, the methods are passed
down, not referred to from the parent. That is, Parent does have its
own critique method, not a reference to Grand_parent.critique(). So
when Child calls self.advise, it is calling its inherrited copy. Then,
since the inherited Child.advise() from Parent.advise() calls
self.critique, it calls it's own overriden critique method.

I hope this makes sense.




More information about the Python-list mailing list