[issue32615] Inconsistent behavior if globals is a dict subclass

Terry J. Reedy report at bugs.python.org
Mon Dec 30 17:40:05 EST 2019


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Victor, Pablo, I added you two since you commented on the duplicate.

I believe this should be closed as 'not a bug'.  The doc for globals() says is returns a 'dictionary', meaning an instance of dict.  The doc for exec says globals "must be a dictionary (and not a subclass of dictionary)".  (This is mere implied when locals is also given, but it *is* implied.).  The behavior when globals is otherwise is undefined.

----------
nosy: +pablogsal, vstinner
versions: +Python 3.9 -Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32615>
_______________________________________


More information about the Python-bugs-list mailing list