[Python-ideas] float('∞')=float('inf')

Alexander Belopolsky alexander.belopolsky at gmail.com
Sun Jul 14 04:17:46 CEST 2013


On Sat, Jul 13, 2013 at 9:24 PM, Steven D'Aprano <steve at pearwood.info>wrote:

> Or even having literal ∞ recognised as float('inf')


BTW, if having literal ∞ was considered as a language feature [1], I would
support it:

if x == ∞: ...

would be an improvement over existing alternatives

if x == float('inf'): ...

or

if math.isinf(x): ...

But float('∞') still looks like line noise.


[1] .. for some language other than Python.  In that language empty set
would be spelled ∅ and string catenation operator would be ⋈.  :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130713/00fbef8b/attachment.html>


More information about the Python-ideas mailing list