On 25 May 2005 21:31:57 -0700, Sriek <[EMAIL PROTECTED]> wrote: > hi, > i come from a c++ background. i ws happy to find myself on quite > familiar grounds with Python. But, what surprised me was the fact that > the __init__(), which is said to be the equivlent of the constructor in > c++, is not automatically called. I'm sure there must be ample reason > for this. I would like to know why this is so? This is my view is more > burden on the programmer.
>>> class C: ... def __init__(self): print "Hello" ... >>> c = C() Hello This looks like __init__ being called automatically to me. Are you doing something different? > Similarly, why do we have to explicitly use the 'self' keyword > everytime? http://www.python.org/doc/faq/general.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls > > Every kind of help would be welcome. No worries, Tim > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list