How do I do this? (eval() on the left hand side)

Nick Coghlan ncoghlan at iinet.net.au
Wed Dec 8 07:02:03 EST 2004


Caleb Hattingh wrote:
> '>>> a              # The value of a is changed.
> 8
> '>>>

The value of a is changed. . . *maybe*.

The Python language definition states explicitly that updates to the dictionary 
returned by locals() may not actually alter the local variables.

Generally, altering the contents of the dicts returned by locals() and globals() 
is unreliable at best.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list