On Wed, 6 Jul 2016 02:13 am, eryk sun wrote: > On Tue, Jul 5, 2016 at 3:50 PM, Steven D'Aprano <st...@pearwood.info> > wrote: >> It works with exec: [...] > No, actually it doesn't work. Remember that when you store to a > variable, it's implicitly a local variable, for which CPython uses > STORE_NAME in unoptimized code. To test this properly you need to > declare the variable as global, so that it uses STORE_GLOBAL:
/face-palm Of course you're right, I knew that. Sorry for the noise. -- Steven “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list