super question

Lee Harr missive at frontiernet.net
Mon Apr 7 21:03:44 EDT 2003


In article <b6soav$7p2$1 at panix1.panix.com>, Aahz wrote:
> In article <fd1c664e.0304071056.31a0d377 at posting.google.com>,
> Danra <danra at walla.co.il> wrote:
>>
>>Here's my experience with 'super':
>>
>>>>> class b:
>>	pass
> 
> No time to test, but try:
> 
>     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?





More information about the Python-list mailing list