-
Piotr Maślanka authored914d4fd5
json.rst 753 B
JSON
In order to better support JSON, you should declare each of your class that supports being converted to JSON with
Then you can convert structures made out of standard serializable Python JSON objects, such as dicts and lists, and also JSONAble objects, by this all
You might also want to check out the JSONEncoder satella uses to do it.
This will serialize unknown objects in the following way. First, __dict__ will be extracted out of this object. The dictionary will be constructed in such a way, that for each key in this __dict__, it's value's repr will be assigned.