This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ethan.furman
Recipients anders.rundgren.net@gmail.com, barry, bob.ippolito, eli.bendersky, ethan.furman, ncoghlan, rhettinger
Date 2014-12-30.00:19:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419898767.57.0.953315982194.issue23123@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2014-12-30 00:19:27ethan.furmansetrecipients: + ethan.furman, barry, rhettinger, bob.ippolito, ncoghlan, eli.bendersky, anders.rundgren.net@gmail.com
2014-12-30 00:19:27ethan.furmansetmessageid: <1419898767.57.0.953315982194.issue23123@psf.upfronthosting.co.za>
2014-12-30 00:19:27ethan.furmanlinkissue23123 messages
2014-12-30 00:19:27ethan.furmancreate