On Sun, 29 Nov 2015 07:05:30 -0800, cescus92 wrote:

> In this day I stumbled upon a very simple task: I had a list of
> instances of a custom class and I had to convert i into a JSON.

That's all well and good, but firstly you need to both dumps and loads to 
work properly with json, and secondly there's no mechanism in json that 
tells you what class of object you have.

So you may have a __json_dumps__ that will dump your object out to a json 
string representation, but then how does json.loads recognise that it's 
loading your object to call your object's __json_loads__?

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to