[Python-ideas] JSON encoder protocol

2019-08-16 Thread Stephen J. Turnbull
Wes Turner writes: > Data interchange with structured types is worthwhile. That's not what the main thread is about. It's about adding support for Decimal to the stdlib's json module. Even the OP has explicitly disclaimed pretty much everything else, although his preferred implementation is mo

[Python-ideas] JSON encoder protocol (was Re: adding support for a "raw output" in JSON serializer)

2019-08-11 Thread Chris Angelico
On Mon, Aug 12, 2019 at 10:09 AM David Shawley wrote: > > On Aug 8, 2019, at 3:55 PM, Chris Angelico wrote: > > 2) Should there be a protocol obj.__json__() to return a string > > representation of an object for direct insertion into a JSON file? > > I'm inclined towards the protocol, since there