Feature request to (optionally) support "Python JSON" number extensions
Open
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 336
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 4
Description
It would be really great if Aeson was able to parse (and re-serialize) JSON generated with the Python `json` module, which has some extra (non-spec) features with regard to numbers:
```python
import json
import math
print(
json.dumps(
{
"foo": 99,
"bar": math.nan,
"baz": -math.inf
}
)
)
```
which yields
```
{"foo": 99, "bar": NaN, "baz": -Infinity}
```
I think `NaN`, `Infinity` and `-Infinity` are the only extra tokens that occur.
For me personally this comes up when working with JSON generated by data-scientists, where Python is the main language and these values seem to occur often.
Contributor guide
Assessment
This issue has not been assessed yet.