this is a question and not a bug so feel free to close. I maintain cattrs, which is a layer above orjson. Cattrs contains a preconfigured converter specifically for orjson. I am considering an optimization and wanted to check first.
When orjson loads a JSON object into a dictionary, is it possible for that dictionary to contain non-string keys? As far as I know, the JSON standard (I guess the ECMA-404) mandates object keys be strings - does orjson ensure this?
I'm asking since if this is true, I can skip validating mapping keys when structuring into dict[str, T], Mapping[str, T], thus speeding up these operations.
Hi,
this is a question and not a bug so feel free to close. I maintain cattrs, which is a layer above orjson. Cattrs contains a preconfigured converter specifically for orjson. I am considering an optimization and wanted to check first.
When orjson loads a JSON object into a dictionary, is it possible for that dictionary to contain non-string keys? As far as I know, the JSON standard (I guess the ECMA-404) mandates object keys be strings - does orjson ensure this?
I'm asking since if this is true, I can skip validating mapping keys when structuring into
dict[str, T]
,Mapping[str, T]
, thus speeding up these operations.