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


Groups > comp.lang.python > #65145

Re: __init__ is the initialiser

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'mrab': 0.05; 'say,': 0.05; '__init__': 0.09; 'constructor': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '__new__': 0.16; 'initializes': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'ignore': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'days,': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'post.': 0.31; 'comment': 0.34; 'subject:the': 0.34; "i'd": 0.34; "can't": 0.35; 'point.': 0.35; 'explains': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'previous': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'called': 0.40; 'teaching': 0.64; 'batchelder': 0.84; 'ethan': 0.84; 'furman': 0.84; 'choice.': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: __init__ is the initialiser
Date Fri, 31 Jan 2014 17:44:30 -0500
References <lcgtpf$tui$1@ger.gmane.org> <lcgut2$b8r$1@ger.gmane.org> <52EC0C0A.7010508@mrabarnett.plus.com> <52EC0E3C.5070900@stoneleaf.us>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 18.189.30.229
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To <52EC0E3C.5070900@stoneleaf.us>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6225.1391208282.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391208282 news.xs4all.nl 2948 [2001:888:2000:d::a6]:32845
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65145

Show key headers only | View raw


On 1/31/14 3:57 PM, Ethan Furman wrote:
> On 01/31/2014 12:48 PM, MRAB wrote:
>> On 2014-01-31 19:52, Ned Batchelder wrote:
>>>
>>> Why can't we call __init__ the constructor and __new__ the allocator?
>>
>> The advantage of calling it the "initialiser" is that it explains why
>> it's called "__init__".
>
> Hm, yes, good point.  Also, __init__ initializes so it is a good
> choice.   Ignore the names comment in my previous post.

These days, when teaching Python, I'd say, "__init__ is an initializer, 
or constructor."

-- 
Ned Batchelder, http://nedbatchelder.com

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


Thread

Re: __init__ is the initialiser Ned Batchelder <ned@nedbatchelder.com> - 2014-01-31 17:44 -0500

csiph-web