Re: Optimizing Python

Tim Peters (tim@ksr.com)
Wed, 27 Oct 93 16:07:44 -0400

> > [tim]
> > In the absence of a
> > from something import *
> > statement, are there other cases where Python cannot (in principle, & at
> > compile time) tell whether the name 'range' denotes the built-in? ...

> [guido]
> Actually, since built-in names come after module-global names, it is
> always possible to sabotage a module by doing something like [importing
> the module and fiddling its namespace directly; or via exec or setattr]

That's OK; it's possible to worm around that in a compiler, and some of
the ways of doing so are even safe <wink>. A first cut would probably
like to assume that built-in names denote built-in objects in the absence
of a contradictory switch/pragma etc, and that would get 95% of the gain
for 5% of the work (in return for being unsafe).

would-be-an-interesting-albeit-involved-project-ly y'rs - tim

Tim Peters tim@ksr.com
not speaking for Kendall Square Research Corp