[Python-ideas] If branch merging

Wolfram Hinderer wolfram.hinderer at googlemail.com
Mon Jun 8 17:24:04 CEST 2015


Am 08.06.2015 um 14:38 schrieb Nick Coghlan:
 > On 8 June 2015 at 22:12, Steven D'Aprano <steve at pearwood.info> wrote:
 >
 > [In relation to named subexpressions leaking to the surrounding
 > namespace by default]
 >
 >>> What does "x[(a.b as b)] = b" mean
 >>
 >> surely it simply means the same as:
 >>
 >>     b = a.b
 >>     x[b] = b
 >
 > Right, but it reveals the execution order jumping around in a way that
 > is less obvious in the absence of side effects.

I'm lost. The evaluation order of today (right hand side first)
would make "x[(a.b as b)] = b" mean

     x[a.b] = b
     b = a.b

(assuming looking up a.b has no side effects).
Would the introduction of named subexpressions change that, and how?




More information about the Python-ideas mailing list