[issue21092] json serializer implicitly stringifies non-string keys
Mark Dickinson added the comment: Sorry; that last commit message should have been for #21902. -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21092 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21092] json serializer implicitly stringifies non-string keys
Roundup Robot added the comment: New changeset 36099a05d76a by Mark Dickinson in branch 'default': Issue #21092: Merge from 3.4. https://hg.python.org/cpython/rev/36099a05d76a -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21092 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21092] json serializer implicitly stringifies non-string keys
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. http://docs.python.org/3.4/library/json.html#json.dumps -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21092 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21092] json serializer implicitly stringifies non-string keys
Changes by Brett Cannon br...@python.org: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21092 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21092] json serializer implicitly stringifies non-string keys
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@python components: Documentation messages: 215105 nosy: cvrebert, docs@python priority: normal severity: normal status: open title: json serializer implicitly stringifies non-string keys versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21092 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com