"inherited" keyword in Python?

jweirich at my-deja.com jweirich at my-deja.com
Tue Dec 5 19:10:58 EST 2000


In article <90gevs02uu1 at news2.newsguy.com>,
  "Alex Martelli" <aleaxit at yahoo.com> wrote:
> "Carsten Gaebler" <cg at schlund.de> wrote in
message
> news:3A2B9EFA.3A64C13B at schlund.de...
> > Hi there!
> >
> > Does Python know something like the
"inherited" keyword from Borland
> > Pascal? In Pascal it is used to call a method
of a class's superclass,
> > i.e. instead of saying "superclass.method()"
you say "inherited
> > method()". Can be quite helpful if you change
the name of the superclass
> > or just forgot it. :-)
>
> Python has multiple inheritance, so there is (in
general) no single
> 'superclass' that you could use that way.

I've heard this argument before, but am not
convinced by it.  The resolution that makes sense
to me is to define "super.method()" to invoke the
method that would have otherwise been invoked if
"self.method()" were not defined in the current
class.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list