<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 7, 2015 at 10:23 AM, Marco Buttu <span dir="ltr"><<a href="mailto:marco.buttu@gmail.com" target="_blank">marco.buttu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 07/01/2015 15:58, Todd wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, this would be a shortcut for that.  math.nan and math.inf are less verbose than float("nan") and float("inf"), even if you aren't already using the math module (fewer characters total, and in particular fewer special characters).  It would also, at least in my opinion, be more readable.  Plus there is already the math.isnan and math.isinf, so I don't think it would be totally out-of-place.<br>
</blockquote>
<br></span>
I totally agree. +1</blockquote><div><br></div><div>Another +1.</div><div><br></div><div>Two points:</div><div><br></div><div>1. The current ways to create inf and nan are not obvious and hard to discover.  It will be nice to have these constants discoverable in tab completion from math.</div><div><br></div><div>2. The repr()s of nan and inf are simply 'nan' and 'inf', not 'float("nan")' and 'float("inf")', so it is natural to expect nan and inf constants in some namespace.</div><div> </div></div></div></div>