On Sun, Nov 4, 2018 at 1:00 AM David Shawley <daveshaw...@gmail.com> wrote:
> Very good point.  The JSON document type only supports object literals,
> numbers, strings, and Boolean literals.  My suggestion was specifically to
> provide an extensible mechanism for encoding arbitrary objects into the
> supported primitives.
>

Okay, so to clarify: We currently have a mechanism for custom encoders
and decoders, which you have to specify as you're thinking about
encoding. But you're proposing having the core json.dumps() allow
objects to customize their own representation. Sounds like a plan, and
not even all that complex a plan.

ChrisA
_______________________________________________
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