Ammar Askar added the comment:
This is intentional, the parsed in JSON doesn't necessarily have to have an
object at the root. This is also what allows you to do:
>>> json.loads("[]")
[]
This behavior is also consistent with browsers, try this in your browser's dev
console:
>
New submission from zack :
the json.loads function think a string variable is a json type, but the
variable is "123"
--
components: Library (Lib)
files: json_test.py
messages: 325639
nosy: jaihong
priority: normal
severity: normal
status: open
title: json module loads function
type: