Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'from:addr:yahoo.co.uk': 0.04; 'subject:Python': 0.06; '21,': 0.07; 'python3': 0.07; 'variables': 0.07; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:language': 0.09; 'wrong,': 0.09; 'python': 0.11; 'language.': 0.14; 'binding.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'rhs': 0.16; 'subject: \n ': 0.16; 'weird': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'header:User-Agent:1': 0.23; '---': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'subject:list': 0.30; 'worked': 0.33; 'fri,': 0.33; 'problem': 0.35; 'but': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'expression': 0.60; 'ian': 0.60; 'free': 0.61; 'viruses': 0.61; 'name': 0.63; 'protection': 0.63; 'our': 0.64; 'talking': 0.65; 'mar': 0.68; 'antivirus': 0.68; 'behavior': 0.77; 'subject:this': 0.83; 'confusing': 0.84; 'received:2': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list) Date: Sat, 22 Mar 2014 17:57:21 +0000 References: <9daf0806-02de-4447-964c-c8f8953c23e5@googlegroups.com> <10101874-2995-4acd-9851-989603f052e3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-198-214.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: X-Antivirus: avast! (VPS 140322-0, 22/03/2014), Outbound message X-Antivirus-Status: Clean 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395511066 news.xs4all.nl 2851 [2001:888:2000:d::a6]:49362 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68786 On 22/03/2014 09:09, Ian Kelly wrote: > On Fri, Mar 21, 2014 at 8:06 PM, Rustom Mody wrote: >> Two: A comprehension variable is not bound but reassigned across the >> comprehension. This problem remains in python3 and causes weird behavior when >> lambdas are put in a comprehension > > Because Python as a language only has the concept of assignment, not > binding. I think it would be weird and confusing if variables worked > this way in comprehensions and nowhere else. > My understanding has always been that an expression of the rhs is bound to a name of the lhs. So is my understanding wrong, or is the above wrong, or are we talking at cross purposes, or what? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com