TeskaLabs / cysimdjson

Very fast Python JSON parsing library
Apache License 2.0
357 stars 16 forks source link

Readme example raises TypeError #53

Open u3Izx9ql7vW4 opened 1 month ago

u3Izx9ql7vW4 commented 1 month ago

Example given in readme throws the following error:

    json_parsed = parser.loads(json_bytes)
                  ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Argument 'content' has incorrect type (expected str, got bytes)

Example copied from read me that throws this error:

import cysimdjson

json_bytes = b'''
{
  "foo": [1,2,[3]]
}
'''

parser = cysimdjson.JSONParser()
json_parsed = parser.loads(json_bytes)

# Access in a Python way
print(json_parsed.json_parsed['foo'])