Acting on this excellent advice, I have patched in a reuse for -1.0, 0.0 and 1.0 for EVE Online. We use vectors and stuff a lot, and 0.0 is very, very common. I'll report on the refcount of this for you shortly.
K > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of Fredrik Lundh > Sent: 29. september 2006 15:11 > To: python-dev@python.org > Subject: Re: [Python-Dev] Caching float(0.0) > > Nick Craig-Wood wrote: > > > Is there any reason why float() shouldn't cache the value > of 0.0 since > > it is by far and away the most common value? > > says who ? > > (I just checked the program I'm working on, and my analysis > tells me that the most common floating point value in that > program is 121.216, which occurs 32 times. from what I can > tell, 0.0 isn't used at all.) > > </F> > > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > http://mail.python.org/mailman/options/python-dev/kristjan%40c cpgames.com > _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com