Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'canvas': 0.07; 'differently': 0.07; '__init__': 0.09; 'attributes': 0.09; 'constructor': 0.09; 'instance.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'mostly': 0.14; 'allocates': 0.16; 'class).': 0.16; 'constructor.': 0.16; 'finney': 0.16; 'java.': 0.16; 'phases.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.18; 'pointed': 0.19; '>>>': 0.22; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "i'm": 0.30; 'default,': 0.31; 'writes:': 0.31; 'class': 0.32; 'minimal': 0.33; 'subject:the': 0.34; 'prepare': 0.35; 'c++': 0.36; 'object,': 0.36; 'similar': 0.36; 'two': 0.37; 'step': 0.37; 'ben': 0.38; 'generic': 0.38; 'needed': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'blank': 0.60; 'customized': 0.61; 'received:173': 0.61; 'different': 0.65; 'hoping': 0.75; 'batchelder': 0.84; 'confusing': 0.84; 'ethan': 0.84; 'furman': 0.84; 'picture.': 0.84; 'received:fios.verizon.net': 0.84; 'typically,': 0.84; 'response,': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: __init__ is the initialiser Date: Fri, 31 Jan 2014 22:16:59 -0500 References: <858utviwgs.fsf@benfinney.id.au> <52EC3C40.7080402@stoneleaf.us> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <52EC3C40.7080402@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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391224639 news.xs4all.nl 2977 [2001:888:2000:d::a6]:39580 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65175 On 1/31/2014 7:13 PM, Ethan Furman wrote: > On 01/31/2014 03:43 PM, Ned Batchelder wrote: >> On 1/31/14 6:05 PM, Ben Finney wrote: >>> Ned Batchelder writes: >> >> I'm not hoping to change any official terminology. I just think that >> calling __init__ anything other than a constructor >> is confusing pedantry. It is a constructor, and Python constructors >> work differently than those in C++ and Java. > > And I would say the opposite. __init__ is not creating anything, As you pointed out in a different response, Python has one default, two-phase constructor. type.__call__. Typically, .__new__ allocates a generic object (with one customization as to class). .__init__ creates, from that mostly generic object, a customized instance of class C with the minimal attributes needed to be an instance of C, with value specific to the instance. Creating a painting on canvas has two similar phases. Prepare a generic blank canvas stretched on a frame and coated with a white undercoat. Paint a particular picture. Would you say that the second step is not creating anything? -- Terry Jan Reedy