Rhodri James wrote:
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.

I think "consenting adults" applies here. Yes, you could use it to
produce invalid JSON, so it's your responsibility to not do that.
And if you do so accidentally, you'll find out about it when other
things (and quite possibly your own thing) fail to read it.

If you really insist on being strict, it could require you to
return a special wrapper type that takes a string of digits and
checks that it conforms to the syntax of a JSON number.

Come to think of it... you could use Decimal as that wrapper
type!

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

Reply via email to