You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using simdjson.Parser.parse, checking if a None key exists in the parsed object results in a TypeError: expected bytes, NoneType found.
Example Code:
importsimdjsonparser=simdjson.Parser()
doc=parser.parse(b'{"res": [{"name": "first"}, {"name": "second"}]}')
ifnotNoneindoc: # This line raises the errorpass
Error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "simdjson/csimdjson.pyx", line 316, in csimdjson.Object.__contains__
TypeError: expected bytes, NoneType found
Expected Behavior
The check should return False (as it does with simdjson.loads), since None is not a valid JSON key.
Issue Description
When using
simdjson.Parser.parse
, checking if aNone
key exists in the parsed object results in aTypeError: expected bytes, NoneType found
.Example Code:
Error:
Expected Behavior
The check should return
False
(as it does withsimdjson.loads
), sinceNone
is not a valid JSON key.Working Example with
simdjson.loads
:The text was updated successfully, but these errors were encountered: