__init__ explanation please

Hrvoje Niksic hniksic at xemacs.org
Mon Jan 14 18:00:45 EST 2008


Ben Finney <bignose+hates-spam at benfinney.id.au> writes:

> Hrvoje Niksic <hniksic at xemacs.org> writes:
>
>> Wildemar Wildenburger <lasses_weil at klapptsowieso.net> writes:
>> > __init__() /initializes/ an instance (automatically after
>> > creation). It is called, /after/ the instance has been constructed
>> 
>> I don't understand the purpose of this "correction".  After all,
>> __init__ *is* the closest equivalent to what other languages would
>> call a constructor.
>
> No. That would be '__new__', which actually constructs the instance,

That's not what other OO languages (C++, Java) actually call a
constructor, so your correction is misplaced.  My other posts in this
thread have expanded on this.



More information about the Python-list mailing list