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

https://en.wikipedia.org/wiki/Tbox

On Tue, Apr 7, 2020, 12:17 AM Greg Ewing <greg.ew...@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.
>
> --
> Greg
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.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/
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/S7B24ISDYEEMEA6FKNK35XQA7WOLTNXQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to