[issue23123] Only READ support for Decimal in json

Bob Ippolito report at bugs.python.org
Mon Dec 29 10:30:16 CET 2014


Bob Ippolito added the comment:

I don't think it's reasonable to expect Decimal to always output precisely the same string it was given. It's a waste of complexity and space and the only time you would want this behavior is when you really should've left it accessible as a string in the first place.

It sounds like the spec for that signature may be poorly designed (with regard to portability). Relying on the precise string output of a number is not going to work in any JSON parser I've ever seen. You'd need to work at the tokenizer level and not all of the parsers provide an interface at that layer (since many of them combine tokenization and parsing).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23123>
_______________________________________


More information about the Python-bugs-list mailing list