[Python-Dev] cpython: locals dictionary in PyRun_String
matt.j.keeter at gmail.com
Tue Jul 14 20:28:31 CEST 2015
The docs for PyRun_String say that both globals and locals should be dictionaries .
However, digging into the source  shows me that locals doesn’t need to be a dictionary;
it just needs to implement the mapping protocol. Is it a bad idea to rely on this fact?
(Context: I’m plugging a custom object into locals that uses __getitem__ to track lookups.)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev