[Python-ideas] Json object-level serializer

Antoine Pitrou solipsis at pitrou.net
Thu Jul 29 13:41:18 CEST 2010


On Thu, 29 Jul 2010 13:35:41 +0200
Tarek Ziadé <ziade.tarek at gmail.com> wrote:
> Hello,
> 
> What about adding in the json package the ability for an object to
> provide a different object to serialize ?
> This would be useful to translate a class into a structure that can be
> passed to json.dumps

How about letting json use the __reduce__ protocol instead?






More information about the Python-ideas mailing list