Author mark.dickinson
Recipients mark.dickinson, skrah
Date 2010-03-23.14:57:45
SpamBayes Score 2.13787e-09
Marked as misclassified No
Message-id <>
Re-opening to address a couple of points that came out of the python-dev discussion:

(1) As Stefan pointed out on python-dev, equality and inequality comparisons involving signaling nans should signal (order comparisons already do).  IEEE 754 is fairly clear on this.  From section 6.2:

"""Signaling NaNs shall be reserved operands that, under default exception handling, signal the invalid operation exception (see 7.2) for every general-computational and signaling-computational operation except for the conversions described in 5.12."""

(Comparisons fall under 'signaling-computational operations, in section 5.6 of the standard.)

I propose to fix this for 2.7 and 3.2.

(2) Currently hash(Decimal("nan")) raises a TypeError.  I can see no good reason for this at all;  it's possible to hash float nans and to put them in sets and dictionaries.  I propose to remove this restriction for 2.7 and 3.2.  I think hash(Decimal("snan")) should also succeed:  *computational* operations on signaling nans should signal, but I don't think that putting a signaling nan into a dict, or checking for its presence in a list, counts as a computational operation for this purpose.
Date User Action Args
2010-03-23 14:57:47mark.dickinsonsetrecipients: + mark.dickinson, skrah
2010-03-23 14:57:47mark.dickinsonsetmessageid: <>
2010-03-23 14:57:46mark.dickinsonlinkissue7279 messages
2010-03-23 14:57:45mark.dickinsoncreate