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 rhettinger
Recipients anders.rundgren.net@gmail.com, bob.ippolito, ethan.furman, rhettinger
Date 2014-12-29.08:30:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419841819.39.0.11705903842.issue23123@psf.upfronthosting.co.za>
In-reply-to
Content
> Given that json is multi-language format ... I don't know 
> that we can expect much more from it.

JSON specifies a textual number format but doesn't dictate whether that format represents a fixed precision binary float point number or a decimal floating point number.  It is perfectly reasonable for someone to want to read and write a JSON number format to and from a decimal (we also see this with database formats as well -- such as sqlite).

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).
History
Date User Action Args
2014-12-29 08:30:19rhettingersetrecipients: + rhettinger, bob.ippolito, ethan.furman, anders.rundgren.net@gmail.com
2014-12-29 08:30:19rhettingersetmessageid: <1419841819.39.0.11705903842.issue23123@psf.upfronthosting.co.za>
2014-12-29 08:30:19rhettingerlinkissue23123 messages
2014-12-29 08:30:18rhettingercreate