[issue24387] json.loads should be idempotent when the argument is a dictionary

CT Radu report at bugs.python.org
Fri Jun 5 14:21:48 CEST 2015


New submission from CT Radu:

Currently, json.loads expects a string as input and is expected to return a dictionary or raise an exception.

Proposal:
If the first argument of json.loads is a dictionary
return that dictionary, instead of raising a TypeError as it happens now.

There are some use cases where json.loads would be applied multiple times to the same object. Once the string has been parsed once, it shouldn't be reloaded.

----------
components: Library (Lib)
messages: 244864
nosy: CT Radu
priority: normal
severity: normal
status: open
title: json.loads should be idempotent when the argument is a dictionary
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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


More information about the Python-bugs-list mailing list