Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:code': 0.07; 'terry': 0.09; 'bug': 0.10; 'cc:addr:python-list': 0.10; 'def': 0.10; 'dec': 0.15; '2.6.4': 0.16; 'afaik.': 0.16; 'bug,': 0.16; 'email addr:udel.edu>': 0.16; 'email name:<tjreedy': 0.16; 'reedy': 0.16; 'subject:dead': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'pointed': 0.17; 'specify': 0.17; '>>>': 0.18; 'issue.': 0.20; 'tracker': 0.20; 'received:209.85.216.46': 0.21; 'occurs': 0.22; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; '-0700,': 0.29; '>>>>': 0.29; "i'm": 0.29; 'version,': 0.30; 'received:google.com': 0.34; 'confirmed': 0.35; 'open': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'should': 0.36; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'think': 0.40; 'between': 0.63; 'out..': 0.84; 'glad': 0.86 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=dPwiusp3p1NCTTd1T2J/hOBvURe+siPg7uYJdkM1CM4=; b=JHFyr77b7AuOpsC8GKUpIG8fHQMIE7hJFhVd6Gs8ML2cTD5YQ2TKkn0l/OQmUPGahT xvz9cscOhMufY4JrXDqSeiDgYVz8sbWdm9G3rrhrlT031CH8UZsXK2fNx7QiRaOdGKp6 15M735GrEtQwFSjBLbdOYSB+KR6JHDRp1CVud8THEWY/RzM9MBb+PhM7VoJm4n8RSWEU UkZm4cA3GTJJVPxcbhY7DvRk0ao8rlMk1RAz7YH6db6t+lJOVb6Flhy2tcSTEgH1alOu d7yhDDi4c8FmW4u/K4qezRXZLD7k9zinJ3ZmOrG/c5AJMXfHRdjv5JlfNlj8RA4BAqmr A38w== MIME-Version: 1.0 In-Reply-To: References: <50bf85c0$0$29994$c3e8da3$5496439d@news.astraweb.com> <20121205182413.GI10865@hud> From: Chris Kaynor Date: Wed, 5 Dec 2012 12:49:24 -0800 Subject: Re: why does dead code costs time? To: Terry Reedy Content-Type: multipart/alternative; boundary=20cf3074b6e04fb12f04d0211f51 X-Gm-Message-State: ALoCoQma3tpuInQ0o9YpGoyeRYaVZp9ZSRyfl9qYOdPKCSNEDmvhj/LJMI8MjTqnhZxLRk3YYFIT Cc: "python-list@python.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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 113 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1354740586 news.xs4all.nl 6902 [2001:888:2000:d::a6]:55144 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34323 --20cf3074b6e04fb12f04d0211f51 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Dec 5, 2012 at 12:41 PM, Terry Reedy wrote: > On 12/5/2012 1:24 PM, Bruno Dupuis wrote: > >> On Wed, Dec 05, 2012 at 10:59:26AM -0700, Ian Kelly wrote: >>> >>> I think this should even be considered a bug, not just a missing >>> optimization. Consider: >>> >> >> This is definitely a bug >> >> globals()['None'] = 42 >>>>>> def f(x): >>>>>> >>>>> ... return None >>> ... print(x) >>> ... >>> >>>> f('test') >>>>>> >>>>> 42 >>> >> >> This one is pretty scary >> >> The difference between `return None` and `return` leads to inconsistency >> and >> is in contradiction with the specs, AFAIK. I'm glad we pointed this out. >> > > You did not specify version, but I confirmed in 3.3.0. Please open a > tracker issue. It also occurs in 2.6.4 --20cf3074b6e04fb12f04d0211f51 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Dec 5, 2012 at 12:41 PM, Terry Reedy <tjreedy@udel.edu> wrote:
On 12/5/2012 1:24 PM, Bruno Dupuis wrote:=
On Wed, Dec 05, 2012 at 10:59:26AM -0700, Ian Kelly wrote:
I think this should even be considered a bug, not just a missing
optimization. =A0Consider:

This is definitely a bug

globals()['None'] =3D 42
def f(x):
... =A0 =A0 return None
... =A0 =A0 print(x)
...
f('test')
42

This one is pretty scary

The difference between `return None` and `return` leads to inconsistency an= d
is in contradiction with the specs, AFAIK. I'm glad we pointed this out= .

You did not specify version, but I confirmed in 3.3.0. Please open a tracke= r issue.

It also occurs in 2.6.4=A0
--20cf3074b6e04fb12f04d0211f51--