parse-time optimizations

Thomas Wouters thomas at
Wed May 30 10:20:46 EDT 2001

On Wed, May 30, 2001 at 01:54:11PM +0000, jcm wrote:

> This is an unambiguous situation.  Don't just think of the program
> text--these transformations would be done on the parse-tree.  In
> Python '+' is left-associative.  We're talking about simple,
> well-understood optimizations.  The reason I am advocating these in
> particular is because they can be done without heavyweight semantic
> analysis.

Read back in this thread. Michael Hudson already reported that his
bytecodehacks packages already has a module to do constant-folding
optimizations. He also says it isn't worth much :) Have you tried it out,
yet ?

Thomas Wouters <thomas at>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!

More information about the Python-list mailing list