[Python-Dev] Mixing float and Decimal -- thread reboot

Nick Coghlan ncoghlan at gmail.com
Thu Mar 25 11:28:03 CET 2010

Steven D'Aprano wrote:
> On Thu, 25 Mar 2010 03:22:29 am Mark Dickinson wrote:
>> The obvious way to do this nan interning for floats would be to put
>> the interning code into PyFloat_FromDouble.  I'm not sure whether
>> this would be worth the cost in terms of added code (and possibly
>> reduced performance, since the nan check would be done every time a
>> float was returned), but I'd be willing to review a patch.
> I hope that it's obvious from my previous post that I do NOT want such 
> interning done, but since I put the idea in people's heads, I wish to 
> reiterate that I'm against the idea: -1 on interning NaNs. For the rare 
> application where it might be useful, it is easy to do in the 
> application code.

Yep, and I'll freely admit I didn't know about the potential additional
state on NaN values, or I wouldn't have suggested interning automatically.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list