[Python-Dev] Caching float(0.0)

Fred L. Drake, Jr. fdrake at acm.org
Wed Oct 4 07:01:06 CEST 2006


On Wednesday 04 October 2006 00:53, Tim Peters wrote:
 > Someone (Fred, I think) introduced a front-end optimization to
 > collapse that to plain LOAD_CONST, doing the negation at compile time.

I did the original change to make negative integers use just LOAD_CONST, but I 
don't think I changed what was generated for float literals.  That could be 
my memory going bad, though.

The code changed several times as people with more numeric-fu that myself 
fixed all sorts of border cases.  I've tried really hard to stay away from 
the code generator since then.  :-)


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>


More information about the Python-Dev mailing list