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
ConstrainedFloat schema: differences between IEEE floats and json #1422
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1422 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 3741 3759 +18
Branches 740 747 +7
=========================================
+ Hits 3741 3759 +18
Continue to review full report at Codecov.
|
good point from @chris-allnutt, we should use the JSON values |
Its tricky because NaN, Infinity, and -Infinity are not valid JSON, but a lot of python json libs include them. |
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
The acid test for me (both semantically and practically) is: what happens in js with (I'm on my phone atm., so don't actually know the answer) |
Difference of styles :) Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
Here is the javascript JSON behaviour (tested in Firefox, but this is a pretty fundamental language feature): >>JSON.stringify({var:Infinity})
"{\"var\":null}"
>>JSON.parse("{\"var\":Infinity}")
SyntaxError: JSON.parse: unexpected character at line 1 column 8 of the JSON data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM.
thanks a lot. |
Change Summary
Modify constraints on ConstrainedFloat schema to account for differences between IEEE floats and json
Transformations applied:
-math.inf
-math.inf
math.inf
math.inf
Related issue number
#1417
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)