[issue21092] json serializer implicitly stringifies non-string keys

Chris Rebert report at bugs.python.org
Sat Mar 29 03:02:12 CET 2014


New submission from Chris Rebert:

Python 3.3.4 (default, Feb 21 2014, 18:00:34) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from json import dumps
>>> dumps({True: True, False: False, None: None, 42: 42})
'{"false": false, "true": true, "42": 42, "null": null}'
>>>


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

----------
assignee: docs at python
components: Documentation
messages: 215105
nosy: cvrebert, docs at python
priority: normal
severity: normal
status: open
title: json serializer implicitly stringifies non-string keys
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21092>
_______________________________________


More information about the Python-bugs-list mailing list