[Python-Dev] Weekly Python Bug/Patch Summary

Tim Peters tim.one at comcast.net
Thu Feb 19 14:33:37 EST 2004

>> At least gcc users would get something much closer to what the
>> standard intends (although their Python wouldn't be portable in
>> these respects).  OTOH, by pure accident, NaN==NaN *happens* to
>> return the intended False today under Windows Python, and if that's
>> changed, via rich comparison, to return True (which MSVC returns for
>> the C expression NaN==NaN), then we've also managed to break
>> currently-working code on Windows.

[Michael Hudson]
> Is MSVC 7 any different here?  I did try to poke around
> msdn.microsoft.com and found:
>     This version of Visual C++ is not conformant with the C99
>     standard.
> which (a) was in a section about the library specifically and (b)
> doesn't answer the question.  Oh, hang on:
> suggests (very much) that this *has* changed.  But "someone" should
> check (I can't).

I don't have 7 running here either, but that article flat-out says NaN
comparisons work correctly now.  I believe it -- after all, it's published
on a Microsoft site, and so is reviewed by 79 major governments for lawsuit
fodder <wink>.

> (I certainly wasn't proposing this change for release23-maint).

We (Python) never promised anything about NaN behavior, so I don't really
care if the "currently working" (by perverse accident) NaN==NaN result
changes under MSVC 6.

>> 754 really isn't friendly to half-assed support.

> Indeed.  But I think were the underlying compiler implements C99
> semantics, it's unfriendly of Python to hide them.

That gets more involved; e.g., float operations should never raise
exceptions then, not even division by 0 (although real 754 support includes
ways to control whether exceptions get raised).

I'm +1 on applying the patch for 2.4 regardless.

More information about the Python-Dev mailing list