Re: [Python-Dev] Python3 compiled listcomp can't see local var - bug or feature?

2018年6月11日 16:11:23 -0700

Skip Montanaro wrote:
Yes, you'll have to pass in locals to exec.
Exec changed between python 2 and 3. It used to be treated
specially by the compiler so that it could see and modify
the locals where it was used. But now it's just an ordinary
function, so you can't expect it to magically know about
anything that's not passed into it.
--
Greg
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to