Eval of expr with 'or' and 'and' within

Cameron Simpson cs at zip.com.au
Fri Jun 14 22:03:08 EDT 2013


On 15Jun2013 01:34, Steven D'Aprano <steve+comp.lang.python at 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 <cs at zip.com.au>

2 strokes are quicker than 4.



More information about the Python-list mailing list