Type information (the TBox) can be serialized along with instances or in a separate schema definition.


On Tue, Apr 7, 2020, 12:17 AM Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
On 7/04/20 4:57 am, Wes Turner wrote:
> Python object > JSONĀ  > object requires type information to be serialized.

Not necessarily -- Java's json library uses reflection on compile
time type information to deserialise json into an object hierarchy.
You tell it the class corresponding to the top level and it figures
out the rest.

Something similar could be done in Python using type annotations.

Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/C4DMLEWXAOQFDTKK7HXQSWQHW4MXDOEK/
Code of Conduct: http://python.org/psf/codeofconduct/