On Apr 8, 2020, at 01:18, Wes Turner <wes.tur...@gmail.com> wrote:
> 
> I don't see the value in using JSON to round-trip from Python to the same 
> Python code.
> 
> External schema is far more useful than embedding part of an ad-hoc nested 
> object schema in type annotations that can't also do or even specify data 
> validations.

But dataclasses with type annotations can express a complete JSON Schema. Or, 
of course, in an ad hoc schema only published in human readable form, as most 
web APIs use today.

> You can already jsonpickle data classes. If you want to share or just publish 
> data, external schema using a web standard is your best bet.

Sure, but you don’t need JSON-LD for that. Again, the fact that type 
annotations are insufficient to represent semantic triples is irrelevant. They 
are sufficient for the case of writing code to parse what YouTube gives you, or 
to provide a documented API that you design to be consumed by other people in 
JS, or to generate a JSON Schema from your legacy collection of classes that 
you can then publish, or to validate that a dataclass hierarchy matches a 
published schema, and so on. All of which are useful.

_______________________________________________
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/XDJELGTCVSDHFNPQA6556CUWC5XUCXTW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to