The openstack_dashboard.api.rest.json_encoder ModuleΒΆ

class openstack_dashboard.api.rest.json_encoder.NaNJSONEncoder(nan_str='NaN', inf_str='1e+999', **kwargs)[source]

Bases: json.encoder.JSONEncoder

iterencode(o, _one_shot=False)[source]

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.

Previous topic

The openstack_dashboard.api.rest.swift Module

Next topic

The openstack_dashboard.api.rest.cinder Module

Project Source

This Page