On Fri, 9 Aug 2019 at 19:53, Richard Musil <risa20...@gmail.com> wrote:

> Joao S. O. Bueno wrote:
> > yes,  just that it should be called dump_as_float and take either a
> > class
> > or a tuple-of-classes
>
> I saw kind of symmetry with the `parse_float` which only accepted one
> class for having only one class on the output as well. Besides there are
> probably not many (different) ways how to write a custom type for JSON
> float in one application. But I cannot see any argument for not having a
> tuple.
>
> > (or maybe just another argument that when set to
> > "True" would
> > work for any object for which isinstance(obj, numbers.Number) is True)
>
> I cannot verify it right now, but if integer (or big int) are derived from
> `numbers.Number` than it would not work as a distinction for a float. Big
> int is already handled by standard module correctly.
>

Maybe we are all just over-discussing a lot of things that could be solved
in a straightforward way by allowing decimal.Decimal to be json
encoded as numbers by default, with no drawbacks whatsoever. The fact that
arbitrarily long integers are encoded with no complaints  up
to now seems to indicate so.
[clip]

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

Reply via email to