On Tue, May 12, 2009 at 9:55 AM, The Green Tea Leaf < thegreenteal...@gmail.com> wrote:
> OK, bad example. But assume I have the same method in both classes and > want to call the method in the parent. > > Can you give a concrete example of _why_ you would want to do this? You can use super, if you really want to, but it can get ugly (I do not fully understand all of supers caveats). I can't think of a case off the top of my head where you would want to call a parent class's method that a child instance has overriden, but I'm sure it happens sometimes. My guess is that you probably want to re-organize your classes, or not use inheritance in this instance, or rename the method in the child class. It's hard to tell without knowing what exactly you're trying to do in your code. (I mean on the end-result level, not on the "I'm trying to call a parent classes method" level. Sorry if this doesn't seem helpful, and I could be wrong here myself, but I don't think that this is something that should happen very often at all, and is probably a pretty rank code smell.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor