Do Re Mi chel La Si Do wrote:
Hi !
Try :
exec f in globals(),locals()
or
exec(f,globals(),locals())
or
exec f in globals(),globals()
or
exec(f,globals(),globals())
Indeed, using 'globals()' and 'locals()' works. However,
both report the same underlaying object, which is a bit
confusing. (Under what circumstances does 'locals()' return
not the same object as 'globals()' ?)
The problem appears to be that
exec f in a, b
where a and b are distinct dictionaries, does not look up
symbols in 'a' when in local scope.
I filed a bug report (#1167300).
Regards,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list