Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Gary Herron Newsgroups: comp.lang.python Subject: Re: def __init__(self): Date: Tue, 26 Apr 2016 07:25:28 -0700 Lines: 24 Message-ID: References: <34e51ef5-9679-40ec-bc8f-47981353e9d7@googlegroups.com> <571F1361.3010402@digipen.edu> <85eg9sn7qo.fsf@benfinney.id.au> <1461678562.2463908.590020129.6D85452C@webmail.messagingengine.com> <571F7A58.1000505@digipen.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de e1V6iAUHDGdegvWL/NszaQF25gDEmZePMVO6tFqfhwEg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.069 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.01; 'newbie': 0.05; 'constructor': 0.07; 'ignoring': 0.09; 'instance.': 0.09; 'python': 0.10; 'suggest': 0.15; '__init__,': 0.16; '__new__': 0.16; 'initializes': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:def': 0.16; 'wrote:': 0.16; 'stick': 0.18; 'saying': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'header :User-Agent:1': 0.26; 'agreed.': 0.29; "can't": 0.32; 'class': 0.33; "i'll": 0.33; 'languages': 0.34; 'tue,': 0.34; 'asking': 0.35; '(and': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'does': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; '(that': 0.63; 'dr.': 0.69; 'skip:\xe2 10': 0.70; '26,': 0.72; '8bit%:43': 0.72; 'received:204': 0.75; '8bit%:46': 0.76; 'institute': 0.77; '(425)': 0.84; '895-4418': 0.84; 'construct': 0.84; 'digipen': 0.84; 'herron': 0.84; 'subject:self': 0.84 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <1461678562.2463908.590020129.6D85452C@webmail.messagingengine.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <571F7A58.1000505@digipen.edu> X-Mailman-Original-References: <34e51ef5-9679-40ec-bc8f-47981353e9d7@googlegroups.com> <571F1361.3010402@digipen.edu> <85eg9sn7qo.fsf@benfinney.id.au> <1461678562.2463908.590020129.6D85452C@webmail.messagingengine.com> Xref: csiph.com comp.lang.python:107653 On 04/26/2016 06:49 AM, Random832 wrote: > On Tue, Apr 26, 2016, at 03:34, Ben Finney wrote: >> That's needlessly confusing: =E2=80=98__init__=E2=80=99 is not a const= ructor because it >> does not construct the instance. The =E2=80=98__new__=E2=80=99 method = is the constructor >> for a class (and returns the new instance). > the __new__ method is the *allocator*. "constructor" is used in many > languages to name a method that initializes an object once it already > "exists". Saying you can't call it that in Python is needlessly > confusing. Agreed. For a newbie asking about __init__, I'll stick with my original = answer (that it's the constructor), and suggest ignoring the overly=20 pedantic (and confusing) response to the contrary. --=20 Dr. Gary Herron Professor of Computer Science DigiPen Institute of Technology (425) 895-4418