Message233165
> 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). |
|
Date |
User |
Action |
Args |
2014-12-29 08:30:19 | rhettinger | set | recipients:
+ rhettinger, bob.ippolito, ethan.furman, anders.rundgren.net@gmail.com |
2014-12-29 08:30:19 | rhettinger | set | messageid: <1419841819.39.0.11705903842.issue23123@psf.upfronthosting.co.za> |
2014-12-29 08:30:19 | rhettinger | link | issue23123 messages |
2014-12-29 08:30:18 | rhettinger | create | |
|