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

2015-07-14 Thread Nick Coghlan
On 15 July 2015 at 05:44, Matthew Keeter wrote: > One more data point: > On the Python side, exec has documentation > (https://docs.python.org/3/library/functions.html#exec) > that nicely reflects what’s going on in the frame code (where globals must > be a dict but locals can be > any mapping obj

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

2015-07-14 Thread Matthew Keeter
One more data point: On the Python side, exec has documentation (https://docs.python.org/3/library/functions.html#exec) that nicely reflects what’s going on in the frame code (where globals must be a dict but locals can be any mapping object). I’ll file a bug to see what people think about loose

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

2015-07-14 Thread Brett Cannon
On Tue, Jul 14, 2015 at 11:39 AM Matthew Keeter wrote: > 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