On 15Jun2013 01:34, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: | On Sat, 15 Jun 2013 00:09:31 +0100, Nobody wrote: | | > On Sat, 15 Jun 2013 03:56:28 +1000, Chris Angelico wrote: | >> With a few random oddities: | >>>>> bool(float("nan")) | >> True | >> I somehow expected NaN to be false. Maybe that's just my expectations | >> that are wrong, though. | > | > In general, you should expect the behaviour of NaN to be the opposite of | > what you expect. | | ... even taking that into account! *wink* | | Everyone is aware that there is more than one NAN, right?
I was not. Interesting. | If my | calculations are correct, there are 9007199254740992 distinct float NANs | in Python (although there is no direct way of distinguishing them). Wouldn't id() do it? At least in terms of telling them apart? I gather they're not inspectable in Python? Cheers, -- Cameron Simpson <c...@zip.com.au> 2 strokes are quicker than 4. -- http://mail.python.org/mailman/listinfo/python-list