Skip to content

Commit 1460478

Browse files
committed
2.0.11
1 parent 06d4403 commit 1460478

4 files changed

Lines changed: 37 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22

3-
## 2.0.19 - 2019-09-25
3+
## 2.0.11 - 2019-10-01
4+
5+
### Changed
6+
7+
- Publish Python 3.8 wheel for Linux.
8+
9+
## 2.0.10 - 2019-09-25
410

511
### Changed
612

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "orjson"
3-
version = "2.0.10"
3+
version = "2.0.11"
44
authors = ["ijl <ijl@mailbox.org>"]
55
description = "Fast, correct Python JSON library"
66
edition = "2018"

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# orjson
22

33
orjson is a fast, correct JSON library for Python. It benchmarks as the
4-
fastest Python library for JSON and has comprehensive unit, integration, and
5-
interoperability tests.
4+
fastest Python library for JSON and is more correct than the standard json
5+
library or third-party libraries.
66

77
Its serialization performance is 2.5x to 9.5x the nearest
88
other library and 4x to 12x the standard library. Its deserialization
@@ -232,15 +232,32 @@ JSONEncodeError: Integer exceeds 53-bit range
232232

233233
### float
234234

235-
orjson serializes and deserializes float values in a consistent way. The
236-
same behavior is observed in rapidjson, simplejson, and json. ujson is
237-
inaccurate in both serialization and deserialization.
235+
orjson serializes and deserializes floats with no loss of precision and
236+
consistent rounding. The same behavior is observed in rapidjson, simplejson,
237+
and json. ujson is inaccurate in both serialization and deserialization,
238+
i.e., it modifies the data.
239+
240+
`orjson.dumps()` serializes Nan, Infinity, and -Infinity, which are not
241+
compliant JSON, as `null`:
242+
243+
```python
244+
>>> import orjson
245+
>>> orjson.dumps([float("NaN"), float("Infinity"), float("-Infinity")])
246+
b'[null,null,null]'
247+
>>> ujson.dumps([float("NaN"), float("Infinity"), float("-Infinity")])
248+
OverflowError: Invalid Inf value when encoding double
249+
>>> rapidjson.dumps([float("NaN"), float("Infinity"), float("-Infinity")])
250+
'[NaN,Infinity,-Infinity]'
251+
>>> json.dumps([float("NaN"), float("Infinity"), float("-Infinity")])
252+
'[NaN, Infinity, -Infinity]'
253+
```
238254

239255
### UTF-8
240256

241257
orjson raises an exception on invalid UTF-8. This is
242-
necessary because Python 3 str objects may contain UTF-16 surrogates. The
243-
standard library's json module accepts invalid UTF-8.
258+
necessary because Python 3 `str` objects may contain UTF-16 surrogates.
259+
260+
The standard library's json module deserializes and serializes invalid UTF-8.
244261

245262
```python
246263
>>> import orjson, ujson, rapidjson, json

0 commit comments

Comments
 (0)