Benjamin Peterson added the comment: Basically, it calls locals() in the function scope, which is undefined behavior. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue16781> _______________________________________