How to create dynamical scoped variables in Python?
问题 I am translating some code from lisp to Python. In lisp, you can have a let construct with the variables introduced declared as special and thus having dynamic scope. (See http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping) How can I do likewise in Python? It seems the language does not support this directly, if true, what would be a good way to emulate it? 回答1: I feel Justice is plain right in his reasoning here. On the other hand -- I can't resist implementing proof of concept for