[docs] [issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

Mark Dickinson report at bugs.python.org
Mon Jun 18 14:12:26 CEST 2012


Mark Dickinson <dickinsm at gmail.com> added the comment:

This looks like a documentation issue:  it's well documented that in the exec statement, the globals dictionary must be a dict.  What's not so clear from the documentation (AFAICT) is that it must actually have *type* dict, rather than merely being an instance of dict.  (Or, from experimentation, it *can* be an instance of a dict subclass, but the underlying C-implemented dict methods are called directly, so overloads for __getitem__ and the like don't have any effect.)

----------
assignee:  -> docs at python
components: +Documentation -Interpreter Core
nosy: +docs at python, mark.dickinson
stage:  -> needs patch
type: behavior -> 
versions: +Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15099>
_______________________________________


More information about the docs mailing list