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

Caleb Hattingh caleb1 at telkomsa.net
Thu Dec 9 03:47:23 CET 2004


Peter, I second that.

Nick

In what way is it unreliable?  I can't seem to create a situation where  
the update through globals and locals doesn't work.   Are you referring  
perhaps to the possibility of variables being garbage collected and then  
not being around later when one tries to access them through a string  
name?  I don't know very much about the garbage collector, so I can't say  
for sure.

thx
Caleb

On Wed, 08 Dec 2004 10:38:30 -0500, Peter Hansen <peter at engcorp.com> wrote:

> Nick Coghlan wrote:
>> Generally, altering the contents of the dicts returned by locals() and  
>> globals() is unreliable at best.
>
> Nick, could you please comment on why you say this about globals()?
> I've never heard of any possibility of "unreliability" in updating
> globals() and, as far as I know, a large body of code exists which
> does in fact rely on this -- much of mine included. ;-)
>
> -Peter




More information about the Python-list mailing list