cpython: c13066f752a8 (original) (raw)

Mercurial > cpython

changeset 77099:c13066f752a8 2.7

#14875: Use float('inf') instead of float('1e66666') in the json module. [#14875]

Ezio Melotti ezio.melotti@gmail.com
date Mon, 21 May 2012 17:46:55 -0600
parents 4973c90ce9e6
children a36666c52115
files Lib/json/encoder.py Misc/NEWS
diffstat 2 files changed, 4 insertions(+), 3 deletions(-)[+] [-] Lib/json/encoder.py 3 Misc/NEWS 4

line wrap: on

line diff

--- a/Lib/json/encoder.py +++ b/Lib/json/encoder.py @@ -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):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -64,6 +64,8 @@ Core and Builtins Library ------- +- Issue #14875: Use float('inf') instead of float('1e66666') in the json module. +