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

Nobody nobody at nowhere.com
Fri Jun 14 19:09:31 EDT 2013


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.




More information about the Python-list mailing list