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


Groups > comp.lang.python > #70900

Re: Why has __new__ been implemented as a static method?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!proxad.net!feeder1-2.proxad.net!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 <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.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'static': 0.04; 'guido': 0.05; 'implements': 0.09; 'method,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Why': 0.09; 'subject:method': 0.09; 'python': 0.11; 'jan': 0.12; '__new__': 0.16; 'normally,': 0.16; 'partly': 0.16; 'reason.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; ':-)': 0.16; 'all.': 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; 'am,': 0.29; "skip:' 10": 0.31; 'explained': 0.31; 'class': 0.32; 'maybe': 0.34; "i'd": 0.34; 'could': 0.34; 'knows': 0.35; 'something': 0.35; 'beyond': 0.35; 'but': 0.35; 'there': 0.35; 'words,': 0.36; 'method': 0.36; 'subject:?': 0.36; 'searching': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'received:173': 0.61; 'teaching': 0.64; 'details': 0.65; 'once).': 0.84; 'received:fios.verizon.net': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Why has __new__ been implemented as a static method?
Date Sat, 03 May 2014 16:32:37 -0400
References <lk2gt6$72f$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding quoted-printable
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.5.0
In-Reply-To <lk2gt6$72f$1@ger.gmane.org>
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.9668.1399149214.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1399149214 news.xs4all.nl 2867 [2001:888:2000:d::a6]:58374
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:70900

Show key headers only | View raw


On 5/3/2014 6:37 AM, Jurko Gospodnetić wrote:
>    Hi all.
>
>    I was wandering why Python implements its __new__ method as a static
> and not a class method?

For a technical internal reason that Guido and maybe others have 
explained on pydev (more than once). I forget the details partly because 
I do not care beyond knowing that there is a reason. You might be able 
to find something by searching the pydev archives at gmane.org for 
'__new__ static method'. In other words, Guido knows that it 'should' be 
a class method, if it could be.

>    Normally, I'd chalk this issue up under 'bike-shedding', but it came
> up while teaching others about Python and so does not feel right leaving
> it as 'because that's the way it is'. :-)

'Because that is how it has to be for technical internal reasons beyond 
the scope of my teaching.'

-- 
Terry Jan Reedy

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


Thread

Re: Why has __new__ been implemented as a static method? Terry Reedy <tjreedy@udel.edu> - 2014-05-03 16:32 -0400

csiph-web