super question

Aahz aahz at
Tue Apr 8 15:24:35 CEST 2003

In article <Qdpka.2889$Zu2.2627 at>,
Lee Harr  <missive at> wrote:
>In article <b6soav$7p2$1 at>, Aahz wrote:
>>     class b(object):
>>         pass
>From the super docs ;o)  it says you might do this:
>    class C(B):
>        def meth(self, arg):
>            super(C, self).meth(arg)
>but why not just do:
>    class C(B):
>        def meth(self, arg):
>            B.meth(self, arg)
>Is there any difference?
>Any advantage either way?

The advantage comes when you rename B or when you have multiple base
classes for C.
Aahz (aahz at           <*>

This is Python.  We don't care much about theory, except where it intersects 
with useful practice.  --Aahz,, 2/4/2002

More information about the Python-list mailing list