Bases: json.encoder.JSONEncoder
The sole purpose of defining a custom JSONEncoder class is to override floatstr() inner function, or more specifically the representation of NaN and +/-float(‘inf’) values in a JSON. Although Infinity values are not supported by JSON standard, we still can convince Javascript JSON.parse() to create a Javascript Infinity object if we feed a token 1e+999 to it.