py_yyjson
py_yyjson copied to clipboard
Change behavior for ReaderFlags.BIGNUM_AS_RAW and ReaderFlags.NUMBERS_AS_RAW
This PR makes the following changes:
- Change behavior of
ReaderFlags.BIGNUM_AS_RAW:- Old behavior: Return big numbers (>=
2**64, <-2**63) asDecimals. - New behavior: Return big numbers (>=
2**64, <-2**63) as python long integers.
- Old behavior: Return big numbers (>=
- Change behavior of
ReaderFlags.NUMBERS_AS_RAW:- Old behavior: Return all numbers as
Decimals. - New behavior: Return all numbers as python long integers.
- Old behavior: Return all numbers as
- Added tests to validate behavior of serializing/deserializing numbers with various flags.
Note: These changes are not backward compatible and will probably require a major version bump.
Hi, I realize this is a potentially controversial change and I'm glad to discuss it. Basically, we needed to be able to deserialize large integers without the Decimal() wrapper. This seemed like a good place/way to split it. Hopefully you agree :)