Dot-comma, anyone? (Re: zip or marry etc)

Moshe Zadka moshez at math.huji.ac.il
Thu Jul 27 08:09:19 EDT 2000


On Thu, 27 Jul 2000, jepler epler wrote:

> >We should get to the point where compilers can recognize and optimize
> >built-in functions soon.
> 
> You mean so that
> 	from mystuff import *
> 	print len("actually, this is an argument to mystuff.len()")

Nope. Here's a stategy to optmize and keep Python's semantics. Compile
each code twice: once with those optimizations, and once without
optimizations. Use the opimized version, until you see a "dangerous"
opcode, such as "import *", "exec", or "eval" -- and then use the
non-optimized version. You can even have the "global"s dictionary
maintain weak references to all of the things it is their globals, and
update them if it is tainted by such an opcode, or a direct manipulation
of its __dict__.


--
Moshe Zadka <moshez at math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez





More information about the Python-list mailing list