-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
cannot pickle Decimal #244
Comments
|
This actually prints |
Why do you expect a from decimal import Decimal
string = '1.00000000000000000000000001'
decimal = Decimal(string)
assert str(decimal) == string # OK
assert str(float(decimal)) == string # NOK
assert float(decimal) == decimal # NOK |
I do not expect a |
I provided an example in the stackoverflow thread demonstrating how to do this. Additionally, I added a new https://jsonpickle.readthedocs.io/en/latest/api.html#jsonpickle.pickler.encode It sounds like your use case is pretty specific, so please see the S.O. thread for more details. |
@davvid that is excellent. Thank you very much. |
jsonpickle serializes Decimal as
null
.Steps to reproduce:
This prints:
The text was updated successfully, but these errors were encountered: