On the second though though, what you propose should work right, if:

1) json.dumps will be extended to accept `dump_float` keyword argument, which 
would accept a custom class (for example decimal.Decimal, but could the same 
one which was specified with `parse_float`).

2) Then the serializer when seeing this particular type will do the string 
converson of the object, do the check for valid float as you suggest (as it is 
supposed to be dumping float after all) and then dumps the string into the 
output _but without the double quotes_.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/HDKPBLPIADDLVLNVT363QEQRHUWUGQJ4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to