On 09/08/2019 16:05, Joao S. O. Bueno wrote:
I spent some minutes now trying to encode a Decimal as a JSON "Number" using Python native encoder - it really is not possible. The level of customization for Python encoders just allows a method ("default") that have to return a "known" object type - and if it returns a string, it is included with quotes in the final output - which defeats writting numbers.
I still need some persuasion that this is not the right behaviour as it stands. I get what you want -- "this string of digits is the representation I want to use, please don't put quotes around it" -- but I can't help but feel that it will only encourage more unrealistic expectations.
-- Rhodri James *-* Kynesim Ltd _______________________________________________ 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/PULMVJB2HU5KITPWFUTMFRKMLNOTCTZC/ Code of Conduct: http://python.org/psf/codeofconduct/