Automatic, portable optimization of global access

Paul Rubin http
Thu Apr 15 16:35:19 EDT 2004


python at rcn.com (Raymond Hettinger) writes:
> FWIW, I've posted a brief, but powerful recipe for a bytecode
> optimization that saves known globals as constants:
> 
>     http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940
> 
> It's not psyco, but it does run everywhere and is easy to use.

This looks important and will clean up a lot of code, but what happens
if the function calls exec or eval, or assigns something into
globals(), or whatever?



More information about the Python-list mailing list