__init__ explanation please

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Jan 14 23:24:52 EST 2008


Hrvoje Niksic <hniksic at xemacs.org> writes:

> Ben Finney <bignose+hates-spam at benfinney.id.au> writes:
> 
> > Hrvoje Niksic <hniksic at xemacs.org> writes:
> >> __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

More fool them, then. It seems that the best referent for the term
"constructor" is the thing that does the constructing and returns the
result.

-- 
 \    "Imagine a world without hypothetical situations."  -- Anonymous |
  `\                                                                   |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list