[Python-ideas] math.inf and math.nan constants
Zachary Ware
zachary.ware+pyideas at gmail.com
Mon Jan 12 20:40:20 CET 2015
On Mon, Jan 12, 2015 at 1:33 PM, MRAB <python at mrabarnett.plus.com> wrote:
> I was going to say that calling it "isnan" is in keeping with
> "isdigit", etc, but those are instance methods!
>
> So, why is it "math.isnan(x)" and not "x.isnan()"?
I'm a little curious about this myself, since float.is_nan(),
float.is_inf(), and float.is_finite() are all implemented, but #if 0'd
out.
--
Zach
More information about the Python-ideas
mailing list