ordered sets operations on lists..

Steve Holden steve at holdenweb.com
Sun Feb 12 23:51:33 EST 2006


Felipe Almeida Lessa wrote:
> Em Dom, 2006-02-12 às 23:15 -0500, Steve Holden escreveu:
> 
>>Given that Python 2.4 doesn't even perform simple constant folding for 
>>arithmetic expressions
>>[snip]
> 
> 
> May I ask why doesn't it perform such optimization? Is there any special
> difficulties in doing so with the Python compiler?
> 
As well to ask why the sky is blue, and has those little white things in 
it (unless you live in Arizona) :-)

The basic answer is that so far no developer has felt it worthwhile to 
expend time on adding these optimizations.

> Also, IIRC Psyco does optimize these constant expressions. Or am I
> wrong?
> 
Psyco does some very advanced things, but it does them all at run-time. 
Unless I misunderstand (not unheard of), there are no circumstances 
under which Psyco will improve run-time for a piece of code that is only 
executed once.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC                     www.holdenweb.com
PyCon TX 2006                  www.python.org/pycon/




More information about the Python-list mailing list