Path: csiph.com!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!takemy.news.telefonica.de!telefonica.de!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.101 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.80; '*S*': 0.00; 'assignment': 0.07; 'folks': 0.15; 'assignment.': 0.16; 'lhs': 0.16; 'pairs': 0.16; 'rhs': 0.16; 'weird.': 0.16; 'wrote:': 0.16; 'assign': 0.22; 'seems': 0.23; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'least': 0.27; 'question': 0.27; 'executing': 0.27; 'currently,': 0.29; 'work.': 0.30; 'normally': 0.30; 'true.': 0.33; 'received:10.0': 0.34; 'list': 0.34; 'best,': 0.35; 'could': 0.35; 'but': 0.36; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'really': 0.37; 'done.': 0.37; 'things': 0.38; 'presence': 0.38; 'why': 0.39; 'does': 0.39; 'build': 0.40; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'some': 0.40; 'side': 0.62; 'back': 0.62; 'charset:windows-1252': 0.62; 'fire': 0.63; 'more': 0.63; 'other.': 0.64; 'evaluate': 0.72; 'forth': 0.79; 'first?': 0.84 Date: Fri, 04 Sep 2015 01:25:08 +0200 From: "Sven R. Kunze" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: packing unpacking depends on order. References: <55E6C904.3020602@rece.vub.ac.be> <55E73159.4050508@mail.de> <1441243045.413788.373350650.5DF79DE2@webmail.messagingengine.com> In-Reply-To: <1441243045.413788.373350650.5DF79DE2@webmail.messagingengine.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1022 X-purgate-ID: 154282::1441322710-000007B2-4DC22F76/0/0 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: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1441322712 news.xs4all.nl 23827 [2001:888:2000:d::a6]:33428 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95981 On 03.09.2015 03:17, random832@fastmail.us wrote: > > The question is what does "assign it to the left side at once" even > *mean* in the presence of subscripts? Build up a list of > object-subscript pairs (evaluating all the subscripts, including if any > may have side effects) before executing any __setitem__? I think Ian described how it could be done. > Why is the right side evaluated first? Because that's how things normally work. Evaluate the RHS and assign the value to the LHS. Currently, the generalization of a simple assignment is more like hopping back and forth around the "=". You mentioned side-effects. That is true. Right now, however, the side-effects even fire back to the RHS of the assignment. That is really weird. To me, and as it seems to some other folks here, the RHS should be at least independent of the LHS and vice versa. Both sides may have side-effects, but at least independently from each other. That's at least how I feel about it. Best, Sven