load ( fp ] ] ] ] ] ] ] ) ¶ĭeserialize fp (a. That is, loads(dumps(x)) != x if x has non-string Into JSON and then back into a dictionary, the dictionary may not equal As a result of this, if a dictionary is converted WhenĪ dictionary is converted into JSON, all the keys of the dictionary areĬoerced to strings. Keys in key/value pairs of JSON are always of the type str. Members will be pretty-printed with that indent level. If indent is a non-negative integer, then JSON array elements and object Using the JavaScript equivalents ( NaN, Infinity, -Infinity). Inf, -inf) in strict compliance of the JSON specification, instead of
ValueError to serialize out of range float values ( nan, If allow_nan is False (default: True), then it will be a Will result in an OverflowError (or worse). Reference check for container types will be skipped and a circular reference If check_circular is False (default: True), then the circular Unless fp.write()Įxplicitly understands unicode (as in codecs.getwriter()) Unicode strings or the encoding parameter is used. This usually happens because the input contains IfĮnsure_ascii is False, some chunks written to fp may be
Str instance consisting of ASCII characters only. Output are escaped with \uXXXX sequences, and the result is a If ensure_ascii is True (the default), all non-ASCII characters in the Of a basic type ( str, unicode, int, long,įloat, bool, None) will be skipped instead of raising a If skipkeys is True (default: False), then dict keys that are not Serialize obj as a JSON formatted stream to fp (a. dump ( obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, encoding="utf-8", default=None, sort_keys=False, **kw ) ¶