Nested Scopes Question (exec)

Rainer Deyke root at rainerdeyke.com
Sun Jun 24 19:58:14 EDT 2001


"Ryan LeCompte" <rmlecompte at hotmail.com> wrote in message
news:mailman.993417398.9618.python-list at python.org...
> P.S. --- Aren't the following two calls the same:
>
> exec "print 'hello'"
> exec "print 'hello'" in globals(), locals()

No.  Modifying the dictionary returned from 'locals' does not change the
bindings of local names.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list