Automatic, portable optimization of global access

Paul Rubin http
Fri Apr 16 16:08:11 EDT 2004


python at rcn.com (Raymond Hettinger) writes:
> > Well, it's possible that builtins get changed too.  I've used "len" as
> > a variable a few times without realizing that I was clobbering a builtin.
> 
> Paul, I don't know how to say this more clearly.  Don't use constant
> binding in places where the underlying values can change.

I'm saying your optimization is important enough that it should be run
on everything, except the rare cases where it's invalid to do so, and
running it should not require manual intervention on the user's part.
I think the places where the underlying values can change can be
detected by the compiler enough of the time to usually run the optimizer.



More information about the Python-list mailing list