exec("dir()",d)

Emanuele D'Arrigo manu3d at gmail.com
Sun Aug 9 08:32:46 EDT 2009


Greetings everybody,

I don't quite understand why if I do this:

>>> d = {}
>>> exec("dir()", d)

1) d is no longer empty
2) the content of d now looks like __builtins__.__dict__ but isn't
quite it d == __builtins__.__dict__ returns false.

Can anybody shed some light?

Manu



More information about the Python-list mailing list