On 2013-06-14, Chris Angelico <ros...@gmail.com> wrote: > On Sat, Jun 15, 2013 at 3:49 AM, MRAB <pyt...@mrabarnett.plus.com> wrote: >> The general rule is that an object is true-ish unless it's false-ish >> (there are fewer false-ish objects than true-ish objects, e.g. zero vs >> non-zero int). > > 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.
If you work with floating point long enough you realize that most of your expectations are wrong. Sometimes. Eventually. -- Grant Edwards grant.b.edwards Yow! My pants just went to at high school in the Carlsbad gmail.com Caverns!!! -- http://mail.python.org/mailman/listinfo/python-list