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

2015-06-05 Thread R. David Murray
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 st

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

2015-06-05 Thread Eric V. Smith
Eric V. Smith added the comment: What are the use cases where json.loads would be called on the return from json.loads? It seems to me a better design would be to wrap such calls with a test, instead of having json.loads do this test. Hiding it in json.loads would mask other programming error

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

2015-06-05 Thread CT Radu
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