[pypy-svn] r75804 - in pypy/branch/fast-forward/pypy/objspace/std: . test

benjamin at codespeak.net benjamin at codespeak.net
Sat Jul 3 00:16:17 CEST 2010


Author: benjamin
Date: Sat Jul  3 00:16:15 2010
New Revision: 75804

Modified:
   pypy/branch/fast-forward/pypy/objspace/std/strutil.py
   pypy/branch/fast-forward/pypy/objspace/std/test/test_floatobject.py
Log:
allow +nan, too

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:16:15 2010
@@ -182,7 +182,7 @@
         return -INFINITY
     elif low == "inf" or low == "+inf":
         return INFINITY
-    elif low == "nan" or low == "-nan":
+    elif low == "nan" or low == "-nan" or low == "+nan":
         return NAN
 
     # 1) parse the string into pieces.

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:16:15 2010
@@ -103,6 +103,7 @@
         assert repr(inf) == "inf"
         assert repr(-inf) == "-inf"
         assert repr(float("nan")) == "nan"
+        assert repr(float("+nan")) == "nan"
         assert repr(float("-nAn")) == "nan"
 
     def test_float_unicode(self):



More information about the Pypy-commit mailing list