Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #34322
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:code': 0.07; 'python': 0.09; 'difference,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'bug': 0.10; 'def': 0.10; 'dec': 0.15; '*why*': 0.16; 'afaik.': 0.16; 'bug,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:dead': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'pointed': 0.17; 'specify': 0.17; 'jan': 0.18; '>>>': 0.18; 'issue.': 0.20; 'tracker': 0.20; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'header:X-Complaints- To:1': 0.28; '-0700,': 0.29; "d'aprano": 0.29; 'steven': 0.29; "i'm": 0.29; 'keyword': 0.30; 'version,': 0.30; 'could': 0.32; 'certain': 0.33; 'to:addr:python-list': 0.33; 'confirmed': 0.35; 'open': 0.35; 'pm,': 0.35; 'subject:?': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'should': 0.36; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'days': 0.60; 'between': 0.63; 'believe': 0.69; 'received:fios.verizon.net': 0.84; 'glad': 0.86 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Terry Reedy <tjreedy@udel.edu> |
| Subject | Re: why does dead code costs time? |
| Date | Wed, 05 Dec 2012 15:41:19 -0500 |
| References | <mailman.496.1354722393.29569.python-list@python.org> <50bf85c0$0$29994$c3e8da3$5496439d@news.astraweb.com> <CALwzidnEgW3ksKeXAuv-=TOseMRZ2vzFAUL89q1A+QAMr64KAQ@mail.gmail.com> <20121205182413.GI10865@hud> |
| 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-251-66.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 |
| In-Reply-To | <20121205182413.GI10865@hud> |
| 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 | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.522.1354740106.29569.python-list@python.org> (permalink) |
| Lines | 34 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1354740106 news.xs4all.nl 6980 [2001:888:2000:d::a6]:48274 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:34322 |
Show key headers only | View raw
On 12/5/2012 1:24 PM, Bruno Dupuis wrote:
> On Wed, Dec 05, 2012 at 10:59:26AM -0700, Ian Kelly wrote:
>> On Wed, Dec 5, 2012 at 10:34 AM, Steven D'Aprano
>> <steve+comp.lang.python@pearwood.info> wrote:
>>> The difference is almost certain between the LOAD_CONST and the
>>> LOAD_GLOBAL.
>>>
>>> As to *why* there is such a difference, I believe that's a leftover from
>>> early Python days when None was not a keyword and could be reassigned.
>>
>> 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.
--
Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
why does dead code costs time? Bruno Dupuis <python.ml.bruno.dupuis@lisael.org> - 2012-12-05 16:46 +0100
Re: why does dead code costs time? Neil Cerutti <neilc@norwich.edu> - 2012-12-05 16:15 +0000
Re: why does dead code costs time? Bruno Dupuis <python.ml.bruno.dupuis@lisael.org> - 2012-12-05 17:40 +0100
Re: why does dead code costs time? Ramchandra Apte <maniandram01@gmail.com> - 2012-12-09 06:11 -0800
Re: why does dead code costs time? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-12-09 16:47 +0000
Re: why does dead code costs time? Ramchandra Apte <maniandram01@gmail.com> - 2012-12-12 21:23 -0800
Re: why does dead code costs time? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-13 06:01 +0000
Re: why does dead code costs time? rusi <rustompmody@gmail.com> - 2012-12-12 22:27 -0800
Re: why does dead code costs time? Cameron Simpson <cs@zip.com.au> - 2012-12-13 17:51 +1100
Re: why does dead code costs time? rusi <rustompmody@gmail.com> - 2012-12-12 22:59 -0800
Re: why does dead code costs time? Chris Angelico <rosuav@gmail.com> - 2012-12-13 18:03 +1100
Re: why does dead code costs time? Ramchandra Apte <maniandram01@gmail.com> - 2012-12-12 21:23 -0800
Re: why does dead code costs time? Bruno Dupuis <python.ml.bruno.dupuis@lisael.org> - 2012-12-05 18:19 +0100
Re: why does dead code costs time? Tim Roberts <timr@probo.com> - 2012-12-05 21:20 -0800
Re: why does dead code costs time? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-05 17:34 +0000
Re: why does dead code costs time? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-05 17:39 +0000
Re: why does dead code costs time? Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-05 10:59 -0700
Re: why does dead code costs time? Bruno Dupuis <python.ml.bruno.dupuis@lisael.org> - 2012-12-05 19:24 +0100
Re: why does dead code costs time? Terry Reedy <tjreedy@udel.edu> - 2012-12-05 15:41 -0500
Re: why does dead code costs time? Chris Kaynor <ckaynor@zindagigames.com> - 2012-12-05 12:49 -0800
Re: why does dead code costs time? Bruno Dupuis <python.ml.bruno.dupuis@lisael.org> - 2012-12-05 21:50 +0100
Re: why does dead code costs time? Bruno Dupuis <python.ml.bruno.dupuis@lisael.org> - 2012-12-05 22:58 +0100
csiph-web