I have a string in Python, I want to know if it is valid JSON.
json.loads(mystring) will raise an error if the string is not JSON but I don\'t want to
json.loads(mystring)
why parsing when you can use types as follows:
def is_json(myjson): return type(myjson) == type({}) def is_json_arr(myjson): return type(myjson) == type([{}])