Repository navigation
Conversation
lelit
added a commit
to lelit/python-rapidjson
that referenced
this pull request
Nov 1, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With NM_DECIMAL | NM_NAN, Decimal values such as sNaN, -NaN and NaN123 are written using their Python spelling. Several of those tokens cannot be read back by rapidjson.loads.
Recognize Decimal NaNs and emit the existing canonical NaN token when NM_NAN is enabled. Strict mode still rejects nonfinite values; finite decimals and signed infinities keep their current encoding. The new path retains the encoder's Python error check, including exceptions from actual stream writes.
Validation on native macOS arm64 / CPython 3.13.14:
Canonical encoding does not preserve a NaN's sign, payload or signaling identity. Debug-Python and the supported hosted runtime/platform matrix remain unrun locally.