Ethan Furman added the comment:

Raymond Hettinger added the comment:
-----------------------------------
> This bug report isn't a JSON spec issue; rather, it is about how the JSON 
> module API can
> support (or inhibit) valid use cases.
> 
> AFAICT, the patch to make the API better support enums had the side-effect of 
> inhibiting
> the APIs ability to support number objects that want to control their output 
> via __str__
> or __repr__.  This seems to block-off decimal support and support for 
> controlling displayed
> precision.
> 
> I think the Enum patch is suspect and could be considered a regression.  That 
> said, we
> could simply add direct support for decimals and leave the enum patch 
> in-place (though it
> still impairs a user's ability to control the displayed precision).

The enum patch is in issue18264 if anyone wants to read the discussion.

I am not a regular json user, but my impression is the format is pretty basic, 
and we would be overloading it to try and keep numbers with three decimal 
places as Decimal, and anything else as float.

Isn't json's main purpose to support data exchange between different programs 
of different languages?  Not between different Python programs?

----------
nosy: +barry, eli.bendersky, ncoghlan

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23123>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to