Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65149

Re: __init__ is the initialiser

Date 2014-02-01 10:18 +1100
From Cameron Simpson <cs@zip.com.au>
Subject Re: __init__ is the initialiser
References <858utviwgs.fsf@benfinney.id.au>
Newsgroups comp.lang.python
Message-ID <mailman.6229.1391210314.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 01Feb2014 10:05, Ben Finney <ben+python@benfinney.id.au> wrote:
> Ned Batchelder <ned@nedbatchelder.com> writes:
> > Why can't we call __init__ the constructor and __new__ the allocator?
> 
> Because those terms already have meanings, and “__new__” fits the
> meaning of “constructor” better.

+1 on not giving new conflicting meanings to terms already well
defined in practice.

Better just to make in clear in the __init__ docs that there is a
separate construction step.
-- 
Cameron Simpson <cs@zip.com.au>

On two occasions I have been asked [by members of Parliament],
'Pray, Mr. Babbage, if you put into the machine wrong figures, will
the right answers come out?'  I am not able rightly to apprehend the
kind of confusion of ideas that could provoke such a question.
        - Babbage

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: __init__ is the initialiser Cameron Simpson <cs@zip.com.au> - 2014-02-01 10:18 +1100

csiph-web