On Feb 24, 8:39 am, Miki Tebeka <[email protected]> wrote:
> float('infinity') should be good enough.
Yes, that is the answer however the implementation is inconsistent.
py> float("inf")
inf
py> float("infinity")
inf
py> int("inf")
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
int("inf")
ValueError: invalid literal for int() with base 10: 'inf'
py> int("infinity")
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
int("infinity")
ValueError: invalid literal for int() with base 10: 'infinity'
The best place for INFINITY is a constant of the math module.
# Hypothetical #
py> from math import INFINITY
py> 1 < INFINITY
True
py> 99999999999999999 < INFINITY
True
--
http://mail.python.org/mailman/listinfo/python-list