OOP / language design question

bruno at modulix onurb at xiludom.gro
Thu Apr 27 05:07:43 EDT 2006


Lawrence D'Oliveiro wrote:
> In article <1145969107.837185.212970 at e56g2000cwe.googlegroups.com>,
>  "Carl Banks" <invalidemail at aerojockey.com> wrote:
> 
> 
>>bruno at modulix wrote:
>>
>>>cctv.star at gmail.com wrote:
>>>
>>>>I was wondering, why you always have to remember to call bases'
>>>>constructors
>>>
>>><pedantic>
>>>s/constructors/__init__/
>>>
>>>the __init__() method is *not* the constructor. Object's instanciation
>>>is a two-stage process:  __new__() is called first, then __init__().
>>></pedantic>
>>
>>You know, Python's __init__ has almost the same semantics as C++
>>constructors (they both initialize something that's already been
>>allocated in memory, and neither can return a substitute object).  I
>>actually think constructors are misnamed in C++, they should be called
>>initializers (and destructors finalizers).
> 
> 
> "Constructor" is also the term used for the corresponding method in Java.
> 
> Is there any OO language that does not use "constructor" in this sense? 

Smalltalk. Just like Python, it has constructor *and* initializer.

> I don't think there is one. This is standard OO terminology.

Being "standard" doesn't imply it's accurate.

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list