Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Question about math.pi is mutable Date: Mon, 9 Nov 2015 11:56:39 +1100 Lines: 27 Message-ID: References: <87d1vlzy4p.fsf@elektro.pacujo.net> <878u69zxww.fsf@elektro.pacujo.net> <563eba85$0$1611$c3e8da3$5496439d@news.astraweb.com> <87ziyowy83.fsf@elektro.pacujo.net> <8537wghwjb.fsf@benfinney.id.au> <85y4e8ggrj.fsf@benfinney.id.au> <85twowgfm6.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de qz9Qv1tqXmCx/wzShfhl9gYr1S5tpGH8ZSCtdI2zqDBg== Return-Path: 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; 'received:209.85.223': 0.03; 'compiler': 0.05; 'subject:Question': 0.05; 'attributes': 0.07; 'cc:addr:python-list': 0.09; 'agree,': 0.09; 'immutable': 0.09; 'worse': 0.09; 'advocating': 0.16; 'assumptions': 0.16; 'attributes,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'uses,': 0.16; 'wrote:': 0.16; 'compilation': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'not,': 0.22; 'saying': 0.22; 'disable': 0.22; 'uses.': 0.22; 'am,': 0.23; 'decide': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'module': 0.25; 'message-id:@mail.gmail.com': 0.27; '(my': 0.29; "i'm": 0.30; 'code': 0.30; 'that,': 0.34; 'received:google.com': 0.35; 'nov': 0.35; 'but': 0.36; 'should': 0.36; 'needed': 0.36; 'received:209.85': 0.36; '(and': 0.36; 'depends': 0.36; 'subject:: ': 0.37; 'presence': 0.38; 'received:209': 0.38; 'test': 0.39; 'does': 0.39; "didn't": 0.39; '\xe2\x80\x93': 0.72; 'chrisa': 0.84; 'optimisation': 0.84; 'presumably': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=cPLNPqv0ekVGabcO0HYfc1oosxhKxf+2x+V7V0RG6E4=; b=YI+2mM9wUE/He79FH8e3oUHisX2HQwRoirg0PimaHoVYHOTQ3Jy45I186WoubYKdlt loW8ZkNhrtPXQmCpd7GXBuI5lQfPuUUVPDEZUKO2XXHY7RVO8xaJU/h43v2AnViCxAOa 6J1hKJdZQRu55pL4ahL8/K41RKz2SUD3vwg9RutlWm7yiRCew00jYrOr+HXrzWp3caRW BmJ4sEFZEdJ59BWGhtDIJw9kBn/7R5YKJg5Lghr54PhZ/ZMgEustBGTr/YBXZyRHetir /jY8FbrC0drU3p9Pe7uahpf1JIPTQ7tFOB+Olxk6Rw798o2VjirdKBGZ9coT6E7ha7hu R+aQ== X-Received: by 10.107.16.84 with SMTP id y81mr15033349ioi.19.1447030599667; Sun, 08 Nov 2015 16:56:39 -0800 (PST) In-Reply-To: <85twowgfm6.fsf@benfinney.id.au> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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:98496 On Mon, Nov 9, 2015 at 11:50 AM, Ben Finney wr= ote: > You misunderstand me. I'm not saying the optimisations would be > crippled. I am saying that, in order to achieve those optimisations, the > *test code* would be crippled. > > I am pointing out that the assumption necessary for the optimisation > BartC is advocating =E2=80=93 the optimisation of module attributes to be > immutable after compilation =E2=80=93 depends on crippling the *functiona= lity* > needed for many uses, including test code uses. > > Since the compiler should not be in the position of deciding whether > code is test code or not, it cannot use that criterion to decide whether > to enable or disable the optimisation. > > So either the optimisation should never be enabled (my perference), or > test code will unwittingly be crippled by the assumptions needed for > that optimisation. Hmm, then I was misunderstanding what BartC was advocating. I didn't think it would *fail* in the presence of dynamic attributes, but merely *perform suboptimally* (and presumably worse than current CPython). If it does indeed require crippling the functionality, then I agree, this is a bad idea. ChrisA