Chris Angelico wrote:
That's one of the reasons that a simple solution of "make JSONEncoder
respect decimal.Decimal" was rejected - it would require that the json
module import decimal, which is extremely costly.

I don't follow that -- importing Decimal is a one-time cost, so it's
not going to affect the time to parse large amounts of data. Also it
could be done lazily in response to a use_decimal flag, in which
case the import will only happen if other parts of the program are
already using Decimal, so the import won't cost any more in startup
time.

--
Greg
_______________________________________________
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/VL224S7Z2NSE2EM2L74VU3D5XW6NDJ2L/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to