This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pablogsal, pfalcon, ppperry, terry.reedy, vstinner
Date 2020-01-16.22:18:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579213118.04.0.33684352053.issue32615@roundup.psfhosted.org>
In-reply-to
Content
exec() function is currently quite clear on which types are accepted or not: exact dict for globals, mapping for locals.

*  "If only globals is provided, it must be a dictionary (and not a subclass of dictionary), which will be used for both the global and the local variables."
* "If provided, locals can be any mapping object."

Moreover, the requirement on the exact dict type allowed to implement an optimization on globals in Python 3.8:

"LOAD_GLOBAL instruction now uses new “per opcode cache” mechanism. It is about 40% faster now. (Contributed by Yury Selivanov and Inada Naoki in bpo-26219.)"
History
Date User Action Args
2020-01-16 22:18:38vstinnersetrecipients: + vstinner, terry.reedy, pfalcon, ppperry, pablogsal
2020-01-16 22:18:38vstinnersetmessageid: <1579213118.04.0.33684352053.issue32615@roundup.psfhosted.org>
2020-01-16 22:18:38vstinnerlinkissue32615 messages
2020-01-16 22:18:37vstinnercreate