Python exec performance¶
I finally got around to reading Be careful with exec and eval in Python from the always insightful Armin Ronacher. This is not your typical 'exec/eval is dangerous' post. I distilled the lengthy article to the following useful sidenotes:
-
Useful semi-low level discussion of how imports work
-
-
Always use
compile()if you need to run statement multiple times -
Always run exec in local scope
-