Stackers,
I apologize for this question in advance. It must be a FAQ, but I don't seem to be able to find the answer.
When creating a simple object hierarchy in python, I'd like to be able to invoke methods of the parent class from a derived class. In Perl and Java, there is a keyword for this (super). In Perl, I might do this:
package Foo;
sub frotz() {
return "Bamf";
}
package Bar;
@ISA = qw(Foo);
sub frotz() {
my $str = SUPER::frotz();
return uc($str);
}
In python, it appears that I have to name the parent class explicitly from the child. In the example above, I'd have to do something like Foo::frotz().
This doesn't seem right, since this behavior makes it hard to make deep hierarchies. If children need to know what class defined an inherited method, then all sorts of information pain is created.
Is this an actual limitation in python, a gap in my understanding or both?
Thanks,
--Joe