Re: [Python-Dev] cpython: locals dictionary in PyRun_String

2015-07-14 Thread Matthew Keeter
loosening the restrictions in the C API (which will make it match exec’s documented restrictions). Thanks, Matt On Jul 14, 2015, at 2:47 PM, Brett Cannon wrote: > > > On Tue, Jul 14, 2015 at 11:39 AM Matthew Keeter > wrote: > The docs for PyRun_String say that both globals and l

[Python-Dev] cpython: locals dictionary in PyRun_String

2015-07-14 Thread Matthew Keeter
The docs for PyRun_String say that both globals and locals should be dictionaries [1]. However, digging into the source [2] 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 cu