Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '__init__': 0.09; 'constructor': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'override': 0.09; 'thus,': 0.09; '~ethan~': 0.09; '__new__': 0.16; 'constructs': 0.16; 'devs': 0.16; 'downside': 0.16; 'lisp,': 0.16; 'mean,': 0.16; 'object;': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'header:User- Agent:1': 0.23; 'java': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; "d'aprano": 0.31; 'steven': 0.31; 'themselves': 0.32; 'programmers': 0.33; '"the': 0.34; 'maybe': 0.34; 'subject:the': 0.34; 'but': 0.35; 'c++': 0.36; 'charset:us- ascii': 0.36; 'effort': 0.37; 'two': 0.37; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'event.': 0.60; 'worry': 0.60; 'new': 0.61; 'received:173': 0.61; 'making': 0.63; 'differences,': 0.84; 'etc..': 0.84; 'received:64.5': 0.84 Date: Fri, 31 Jan 2014 20:55:15 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: __init__ is the initialiser References: <52ec6d1f$0$29972$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source-IP: 173.12.184.233 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:36992 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391233325 news.xs4all.nl 2872 [2001:888:2000:d::a6]:57605 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65195 On 01/31/2014 08:35 PM, Chris Angelico wrote: > On Sat, Feb 1, 2014 at 2:42 PM, Steven D'Aprano wrote: >> >> Thus, two methods. __new__ constructs (creates, allocates) a new object; >> __init__ initialises it after the event. > > Yes, but if you think in terms of abstractions, they're both just > steps in the conceptual process of "creating the object". > So maybe it's best to talk about the two methods collectively as > "the constructor", and then let people call the two parts whatever > they will. > I do like the idea of calling __init__ the initializer. The downside > of calling __new__ the constructor is that it'll encourage C++ and > Java programmers to override it and get themselves confused Why do we worry so about other languages? If and when I go to learn C++ or Lisp, I do not expect their devs to be worrying about making their terminology match Python's. Part of the effort is in learning what the terms mean, what the ideology is, the differences, the similarities, etc., etc.. -- ~Ethan~