[issue24387] json.loads should be idempotent when the argument is a dictionary
R. David Murray
report at bugs.python.org
Fri Jun 5 15:23:30 CEST 2015
R. David Murray added the comment:
Agreed that this is not a good API change. If this makes sense for a particular program it is easy to write a wrapper, while the current behavior is much more useful for typical programs. loads is not a "coercion" style call, it is specifically parsing a string, and should fail if passed something it can't parse as a string. Another argument along these lines is that if you call int() on something, you know you get back an int. If you call json.loads and it returns a dictionary unmodified, you do *not* know if you have something that is valid json data or not (that is, it might contain un-jsonifiable objects).
----------
nosy: +r.david.murray
resolution: -> rejected
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24387>
_______________________________________
More information about the Python-bugs-list
mailing list