x = foo()

with:

y = x + 1

x = y + 2

is equivalent to:

x = foo()

y = x + 1

x = y + 2

del y

or after optimization:

x = (foo() + 1) + 2

[Obviously more useful with real code but this is sufficiently illustrative. Also I imagine someone might say it's just foo() + 3 but I don't know the type of foo().]

--- Bruce

--

--- Bruce

Check out my puzzle book and get it free here:

http://J.mp/ingToConclusionsFree (available on iOS)