[pypy-svn] r75803 - in pypy/branch/fast-forward/pypy/objspace/std: . test
benjamin at codespeak.net
benjamin at codespeak.net
Sat Jul 3 00:11:04 CEST 2010
Author: benjamin
Date: Sat Jul 3 00:11:03 2010
New Revision: 75803
Modified:
pypy/branch/fast-forward/pypy/objspace/std/strutil.py
pypy/branch/fast-forward/pypy/objspace/std/test/test_floatobject.py
Log:
allow +inf float string
Modified: pypy/branch/fast-forward/pypy/objspace/std/strutil.py
==============================================================================
--- pypy/branch/fast-forward/pypy/objspace/std/strutil.py (original)
+++ pypy/branch/fast-forward/pypy/objspace/std/strutil.py Sat Jul 3 00:11:03 2010
@@ -180,7 +180,7 @@
low = s.lower()
if low == "-inf":
return -INFINITY
- elif low == "inf":
+ elif low == "inf" or low == "+inf":
return INFINITY
elif low == "nan" or low == "-nan":
return NAN
Modified: pypy/branch/fast-forward/pypy/objspace/std/test/test_floatobject.py
==============================================================================
--- pypy/branch/fast-forward/pypy/objspace/std/test/test_floatobject.py (original)
+++ pypy/branch/fast-forward/pypy/objspace/std/test/test_floatobject.py Sat Jul 3 00:11:03 2010
@@ -94,6 +94,7 @@
assert 42.25 == float("42.25")
inf = 1e200*1e200
assert float("inf") == inf
+ assert float("+inf") == inf
assert float("-INf") == -inf
assert str(inf) == "inf"
assert str(-inf) == "-inf"
More information about the Pypy-commit
mailing list