[Python-ideas] math.inf and math.nan constants
jeanpierreda at gmail.com
Fri Jan 9 06:46:23 CET 2015
On Thu, Jan 8, 2015 at 9:38 PM, Andrew Barnert
<abarnert at yahoo.com.dmarc.invalid> wrote:
> On Wednesday, January 7, 2015 8:10 AM, Steven D'Aprano <steve at pearwood.info> wrote:
>> Python today doesn't give us any simple way to access all those
>> different float NANs, or offer any interpretation of what they might
>> mean, but it might some day. I am strongly opposed to anything which
>> might pre-empt that or discourage future advances.
> I don't think there's really an issue here; the only thing this preempts is using the plain name `float.nan` for such future advances. What's wrong with, say, `float.make_nan(payload=30, quiet=False, sign=True)`? Given that the former is almost certainly going to be used far more often than the latter, the extra characters to type and read for the uncommon case don't seem like a serious problem.
+1, a classmethod is the right place for this.
More information about the Python-ideas