On Sat, Aug 10, 2019 at 11:08 PM Greg Ewing
wrote:
> > I don't think anyone else has come up with, any
> > examples other than Decimal that require this "raw" encoding.
>
> It's possible that someone could have their own custom numeric
> type that they want to encode as a JSON number. But if the
On Aug 8, 2019, at 3:55 PM, Chris Angelico wrote:
>
> There are two broad suggestions that came out of that thread and
> others, and I think it may be worth reopening them.
>
> 1) Should JSONEncoder (the class underlying json.dumps) natively
> support decimal.Decimal, and if so, can it avoid im
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
On Sat, Aug 10, 2019 at 11:20 PM Richard Musil wrote:
> Christopher, let me go through your summary and add some remarks,
> hopefully for the benefit of all (who made it so far) in this conversation:
>
And more comments from me now :-)
> Christopher Barker wrote:
>
> > TL;DR : I propose that p
On Sun, Aug 11, 2019 at 5:12 PM David Shawley wrote:
> 1) Should JSONEncoder (the class underlying json.dumps) natively
> support decimal.Decimal, and if so, can it avoid importing that module
> unnecessarily?
>
> I think yes on both counts :-)
> 2) Should there be a protocol obj.__json__() to r
On Mon, Aug 12, 2019 at 3:01 PM Christopher Barker wrote:
>
> On Sun, Aug 11, 2019 at 5:12 PM David Shawley wrote:
>>
>> 1) Should JSONEncoder (the class underlying json.dumps) natively
>> support decimal.Decimal, and if so, can it avoid importing that module
>> unnecessarily?
>
> I think yes on