-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any plans to simplify customising float
representation?
#296
Comments
No, this is not planned. Why would you want to do this? |
Because I need to reproduce behaviour someone has borrowed from |
That's a very unfortunate scenario, hashing a json encoded string is just asking for trouble. floats are printed at full double precision of course, but an optimal algorithm is used (the fewest digits that will round-trip through a correct parser exactly). The C extension can be disabled (globally), although this is more of a private implementation detail used by the test suite. |
If one needs to change the representation of floats then they have to extend the encoder and override
iterencode
by copying over most of the code and just:_repr=FLOAT_REPR
to something that they need.The text was updated successfully, but these errors were encountered: