-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed serialization for custom ints and floats.
[GitHub issue #57](#57) Fixed serialization for objects that subclass `int` or `float`: Previously we would use the objects __str__ implementation, but that might result in an illegal JSON5 value if the object had customized __str__ to return something illegal. Instead, we follow the lead of the `JSON` module and call `int.__repr__` or `float.__repr__` directly. While I was at it, I added tests for dumps(-inf) and dumps(nan) when those were supposed to be disallowed by `allow_nan=False`.
- Loading branch information
Showing
4 changed files
with
48 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters