我发现,在
simplejson内置
json模块含糊不清的许多情况下,该模块给出了更多的描述性错误。例如,对于列表中最后一项之后的逗号:
json.loads('[1,2,]')....ValueError: No JSON object could be depred
这不是很描述。与以下 *** 作相同
simplejson:
simplejson.loads('[1,2,]')...simplejson.deprer.JSONDepreError: Expecting object: line 1 column 5 (char 5)
好多了!对于其他常见错误(例如大写)也是如此
True。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)