invoking a method from two superclasses

Carl Banks pavlovevidence at gmail.com
Wed Jul 1 03:33:42 CEST 2009


On Jun 30, 6:23 pm, Carl Banks <pavlovevide... at gmail.com> wrote:
> On Jun 30, 5:34 pm, Mitchell L Model <MLMLi... at Comcast.net> wrote:
>
> > Allow me to add to my previous question that certainly the superclass
> > methods can be called explicitly without resorting to super(), e.g.:
>
> >     class C(A, B):
> >         def __init__(self):
> >             A.__init__(self)
> >             B.__init__(self)
>
> > My question is really whether there is any way of getting around the
> > explicit class names by using super()
>
> Yes there is: just make sure that all subclasses also call super.

And by subclasses I mean base classes, of course.  ugh


Carl Banks



More information about the Python-list mailing list