Re: [Python-ideas] Serialization of custom classes.

March 30, 2011
11:17 a.m.
On 2011-03-30, at 13:07 , Jakob Bowyer wrote:
Ignore customjsondumps for now. Im more getting at __json__ being a class method?
As I said, there is a blessed extension mechanism in subclassing JSONEncoder, and as long as all JSONEncoder subclasses correctly call super() they should be composable. And if you decide that your objects will all implement __json__ you can just throw in a generic JSONEncoder for that. What significant gain would an additional __json__ hook provide over it? PS: the simplejson mailing list may be a better suggestion for that kind of things, it's probably where the tip of the development happens.
5080
Age (days ago)
5080
Last active (days ago)
0 comments
1 participants
participants (1)
-
Masklinn