Augument assignment versus regular assignment

Terry Reedy tjreedy at udel.edu
Fri Jul 14 23:46:46 EDT 2006


The problem with understanding augmented assignment is that  it directs the 
compiler and interpreter to do one or maybe two mostly invisible 
optimizations.  To me, the effective meaning of 'evalutating once versus 
twice' is most easily seen in the byte code generated by what is, remember, 
the reference implementation.  What it does is what the 
less-than-super-clear doc means.

I posted the difference for one expression after looking at three other 
pairs.  It is easy to examine such pairs in IDLE and, I presume, in other 
IDEs.

Terry Jan Reedy






More information about the Python-list mailing list