[docs] [issue21092] json serializer implicitly stringifies non-string keys

Berker Peksag report at bugs.python.org
Sat Mar 29 14:34:14 CET 2014

Berker Peksag added the comment:

> This implicit stringification of non-string dictionary keys does not
> currently appear to be documented.

I think this is part of the JSON spec. See http://json.org/object.gif for example.

Also, this is already documented in the json.dumps() documentation:

> Keys in key/value pairs of JSON are always of the type str. When a
> dictionary is converted into JSON, all the keys of the dictionary are
> coerced to strings.


nosy: +berker.peksag

Python tracker <report at bugs.python.org>

More information about the docs mailing list