JSON is very similar to Python syntax. Can all JSON objects directly convert to Python without error?
Example
The following is a valid JSON object:
// Valid JSON
{"foo":"bar"}
This object will directly translate to a Python dictionary with key “foo” and value “bar”:
# Python
json_dict = eval('{"foo":"bar"}')
No. In particular,
true,false, andnullare not Python, although they do have direct equivalents in Python (True,False, andNonerespectively).But when used in Python…