[Python-ideas] math.inf and math.nan constants

Ethan Furman ethan at stoneleaf.us
Wed Jan 7 17:55:43 CET 2015


On 01/07/2015 08:07 AM, Guido van Rossum wrote:
> On Wed, Jan 7, 2015 at 7:23 AM, Marco Buttu wrote:
>> On 07/01/2015 15:58, Todd wrote:
>>> 
>>> 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.
>> 
>>     I totally agree. +1
>
> +1. Let's do it.

Anything special for float('-inf') ?

--
~Ethan~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150107/ae264c8d/attachment.sig>


More information about the Python-ideas mailing list