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


Groups > comp.lang.python > #95981

Re: packing unpacking depends on order.

Date 2015-09-04 01:25 +0200
From "Sven R. Kunze" <srkunze@mail.de>
Subject Re: packing unpacking depends on order.
References <55E6C904.3020602@rece.vub.ac.be> <CAGuvt90dWASEjj=_GiZb4jqV4CDF+qqFLH4VS5m_qhUMx6jbJg@mail.gmail.com> <55E73159.4050508@mail.de> <1441243045.413788.373350650.5DF79DE2@webmail.messagingengine.com>
Newsgroups comp.lang.python
Message-ID <mailman.105.1441322712.8327.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web