Chun-Yu Tseng added the comment: Your solution is quite neat. But it still misses use cases of the `global` statement:
1 y = 2 2 3 def f(): 4 y = 9 5 -> import pdb; pdb.set_trace(); 6 7 f() (Pdb) global y; y 9 (Pdb) global y; y += 1; y 10 (Pdb) globals()['y'] 2 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26072> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com