New submission from Sridhar Ratnakumar <sridh...@activestate.com>:

In [2]: json.dumps({'a': 1, 'b': {'c': 3, None: 5}})
Out[2]: '{"a": 1, "b": {"c": 3, "null": 5}}'

In [3]: j = json.dumps({'a': 1, 'b': {'c': 3, None: 5}})

In [4]: json.loads(j)
Out[4]: {u'a': 1, u'b': {u'c': 3, u'null': 5}}

I was surprised to note that None was converted to "null" instead of 
null. This happens only in dicts and not, for example, lists:

In [5]: json.dumps([None, 1, "a"])
Out[5]: '[null, 1, "a"]'

----------
components: Library (Lib)
messages: 90896
nosy: srid
severity: normal
status: open
title: json.dumps converts None to "null" (not null)
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6566>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to