__init__ explanation please

Ben Finney bignose+hates-spam at benfinney.id.au
Tue Jan 15 05:24:52 CET 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