]> granicus.if.org Git - python/commitdiff
#14875: Use float('inf') instead of float('1e66666') in the json module.
authorEzio Melotti <ezio.melotti@gmail.com>
Mon, 21 May 2012 23:49:06 +0000 (17:49 -0600)
committerEzio Melotti <ezio.melotti@gmail.com>
Mon, 21 May 2012 23:49:06 +0000 (17:49 -0600)
Lib/json/encoder.py
Misc/NEWS

index 4b214eb60e82130cb24d14f097b9c8f4896762cf..75b7f494b3f00b299e509eb5aab66bdcd186868d 100644 (file)
@@ -27,8 +27,7 @@ for i in range(0x20):
     ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i))
     #ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))
 
-# Assume this produces an infinity on all machines (probably not guaranteed)
-INFINITY = float('1e66666')
+INFINITY = float('inf')
 FLOAT_REPR = repr
 
 def encode_basestring(s):
index 1540478d9c74ffab0b91a9c26291079db61e8664..ec5cd9878e4f608ac2b9c1ff4bdae99f8c546779 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -67,6 +67,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #14875: Use float('inf') instead of float('1e66666') in the json module.
+
 - Issue #14426: Correct the Date format in Expires attribute of Set-Cookie
   Header in Cookie.py.