using super

Paul McGuire ptmcg at austin.rr.com
Sun Oct 19 17:36:40 EDT 2003


> Here's the code:

You will also need to correct:
    super(B, self).__init()
to read
    super(B, self).__init__()


> class A:
>     def __init__(self):
>         print 'A'
>
> class B(A):
>     def __init__(self):
>         super(B, self).__init()    <<<====
>         print 'B'
>
> def main():
>     b = B()
>
> if __name__ == '__main__':
>     main()
>







More information about the Python-list mailing list