Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'mentioned,': 0.07; '__init__': 0.09; 'constructor': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:using': 0.09; 'python': 0.11; '__new__': 0.16; 'initialiser': 0.16; 'overriding': 0.16; 'personally,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'red,': 0.16; 'subclass': 0.16; 'subject:class': 0.16; 'subject:member': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'knowledge': 0.35; 'but': 0.35; 'ben': 0.38; 'to:addr :python-list': 0.38; 'ability': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'most': 0.60; 'mentioned': 0.61; "you've": 0.63 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: skipping __init__ and using exploiting a class member instead Date: Sun, 20 Oct 2013 14:16:12 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-19-253.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 In-Reply-To: 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382274992 news.xs4all.nl 15985 [2001:888:2000:d::a6]:53170 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57149 On 20/10/2013 08:09, Peter Cacioppi wrote: > > Personally, I find the ability of Python to subclass without overriding the constructor very elegant. > __new__ is the constructor which to my knowledge you've not mentioned, __init__ is the initialiser as mentioned by Ben Finney. -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence