Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95981 > unrolled thread

Re: packing unpacking depends on order.

Started by"Sven R. Kunze" <srkunze@mail.de>
First post2015-09-04 01:25 +0200
Last post2015-09-04 01:25 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: packing unpacking depends on order. "Sven R. Kunze" <srkunze@mail.de> - 2015-09-04 01:25 +0200

#95981 — Re: packing unpacking depends on order.

From"Sven R. Kunze" <srkunze@mail.de>
Date2015-09-04 01:25 +0200
SubjectRe: packing unpacking depends on order.
Message-ID<mailman.105.1441322712.8327.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web