Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.085 X-Spam-Evidence: '*H*': 0.84; '*S*': 0.01; 'cpython': 0.05; 'subject:two': 0.07; 'global,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'increment': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'byte': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'says': 0.33; 'could': 0.34; 'subject:with': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'nov': 0.38; 'subject:needed': 0.38; 'pm,': 0.38; 'even': 0.60; 'above,': 0.60; 'hope': 0.61; 'break': 0.61; 'subject:skip:C 10': 0.61; 'today': 0.64; 'anything.': 0.68; 'grow': 0.77; 'different.': 0.84; "it'd": 0.84; 'local,': 0.84; 'to:none': 0.92; 'tomorrow': 0.95 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; bh=nxHjw5ly4rQAqnOJWrLtPmFSCIoU0uXsYdBAyShUbUw=; b=IZS37ur44WdLvzn7Gj0+WE8lRQ/3StV206cLPhIutUS3ZkcGAoCsJau71m4U+KaQTd qt9fwWXAplAorfEl6sWFLNO9j69RmBGwcAR2aWZMt87TBBqWuWifIYo2s9LFpqyRpDKm KTBiSphghiwpj0b4oyMKXB9D7DzwnRZUkQonCQ6wDRRP1zq+vZwNRrgx5Zr3Vu4s59Us 6cIB+Jdhakqhy6Br++Zm2oDfgwdk2tuFv37ypIvYKG0avJWkjqV5+BOkZj6aI8PNXesW gXvfYW8ccPOJAdaTrSKyuuQ3vqCV0m5DO1+RGMaSt+Hb9JCcA2y158GtIIa8hT9C3qtq UQAA== MIME-Version: 1.0 X-Received: by 10.50.152.104 with SMTP id ux8mr9716120igb.14.1416804693922; Sun, 23 Nov 2014 20:51:33 -0800 (PST) In-Reply-To: <5472b74d$0$12979$c3e8da3$5496439d@news.astraweb.com> References: <002501d00733$6995dce0$3cc196a0$@gmail.com> <07f25264-1286-4d98-820c-949dba711248@googlegroups.com> <5472b74d$0$12979$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 24 Nov 2014 15:51:33 +1100 Subject: Re: Comprehension with two variables - explanation needed From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416804702 news.xs4all.nl 2922 [2001:888:2000:d::a6]:56586 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81426 On Mon, Nov 24, 2014 at 3:42 PM, Steven D'Aprano wrote: > Today dis() returns the above, tomorrow it may return: > > 0 LOAD_GLOBAL 0 (x) > 3 INCREMENT > 5 RETURN_VALUE > > (say), and the Python code remains the same even though the byte code is > different. I hope not! The x in the original function was a local, not a global, and if dis.dis() says LOAD_GLOBAL for something that's not global, it would be *very* confusing! :) But yes, CPython could grow an INCREMENT bytecode, and it'd not break anything. ChrisA