No. In fact, in (I believe most) Python implementations, it str(object)wraps the string in single quotes, which is not valid JSON.
Example:
In [17]: print str({"a": 1})
{'a': 1}
str(boolean) JSON is also invalid:
In [18]: print str(True)
True
__str__however, it can be overridden in custom classes to ensure that objects return JSON representations themselves.
source
share