Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?) Date: Sat, 26 Mar 2016 13:45:13 -0400 Organization: IISS Elusive Unicorn Lines: 20 Message-ID: References: <56f42d9f$0$1618$c3e8da3$5496439d@news.astraweb.com> <56f565e4$0$1614$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de oTbzuBVv7jPJG5U0XQOYqARmJA9PcWk6uFkVeAsgy2Dg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:which': 0.09; '2016': 0.16; '>that': 0.16; 'eval': 0.16; 'intuition': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'url:home': 0.18; 'exec': 0.22; 'sat,': 0.23; 'module': 0.25; 'header:X-Complaints-To:1': 0.26; 'module.': 0.27; 'function': 0.28; 'probably': 0.31; "d'aprano": 0.33; 'steven': 0.33; 'except': 0.34; 'skip:> 10': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'presence': 0.38; '(1)': 0.38; 'to:addr:python.org': 0.40; 'subject:The': 0.61; 'body': 0.61; 'within': 0.64; 'mar': 0.65; 'dennis': 0.91; 'difficult,': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-73-117-233.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105776 On Sat, 26 Mar 2016 03:22:58 +1100, Steven D'Aprano declaimed the following: >(3) and the body of the for-loop has no side-effects that might affect the >truth of (1) > >I don't have an intuition on how hard #3 (does the loop body have any >side-effects that might affect this optimization?) might be, except to say >that the presence of an eval or exec inside the body will probably make the >optimization unsafe. > Probably very difficult, if the loop is at top-level (making "i" a module global), and if the loop body can call any function that might declare "global i" within the same module. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/