invoking a method from two superclasses

Lie Ryan lie.1296 at gmail.com
Thu Jul 2 13:18:00 EDT 2009


Carl Banks wrote:
> 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

super() is short for two things:
1) superharmful
2) superuseful



More information about the Python-list mailing list