calling super()

Jarek Zgoda jzgoda at o2.usun.pl
Wed Apr 4 15:31:58 EDT 2007


Finger.Octopus at gmail.com napisał(a):

> Hello, I have been trying to call the super constructor from my
> derived class but its not working as expected. See the code:
> 
> class HTMLMain:
>     def __init__(self):
>         self.text = "<HTML><BODY>";
>         print(self.text);
>     def __del__(self):
>         self.text = "</BODY></HTML>";
>         print(self.text);
> 
> class NewPage(HTMLMain):
>     def __init__(self):
>         print 'derive2 init'
>         super(NewPage, self).__init__();

This should read: super(HTMLMain, self).__init__()

I think it's just a quick-type-typo. ;)

-- 
Jarek Zgoda
http://jpa.berlios.de/



More information about the Python-list mailing list