Re: __init__() not called automatically
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: __init__() not called automatically

From: Sakesun Roykiattisak <sakesun@boonthavorn.com>
Date: Thu May 26 2005 - 08:25:05 CEST

Does c++ call base class constructor automatically ??
If I'm not wrong, in c++ you also have to call base class constructor
explicitly.
Python just do not enforce the rule. You can leave it as desire.

BTW, I've once been an C++ expert. Knowing python kill that skill.
However, I'm not regret. I have c++ compiler installed, but I don't even
bother validate my last paragraph assertion. Too disgusting. ;)

Sriek wrote:

>Tim pointed out rightly that i missed out the most crucial part of my
>question.
>i should have said that __init__() is not called automatically only for
>the inheritance hierarchy. we must explicitly call all the base class
>__init__() fuctions explicitly.
> i wanted a reason for that.
>Thanks Tim.
>
>
Received on Thu Sep 29 16:14:06 2005