David Shawley wrote:
I'm +1 on adding support for serializing datetime.date and
datetime.datetime *but* I'm -1 on automatically deserializing anything that
looks like a ISO-8601 in json.load*.  The asymmetry is the only thing that
kept me from bringing this up previously.

This asymmetry bothers me too. It makes me think that datetime
handling belongs at a different level of abstraction, something
that knows about the structure of the data being serialised or
deserialised.

Java's JSON libraries have a mechanism where you can give it
a class and a lump of JSON and it will figure out from runtime
type information what to do. It seems like we should be able
to do something similar using type annotations.

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to