TkTech / pysimdjson

Python bindings for the simdjson project.
https://pysimdjson.tkte.ch
Other
643 stars 54 forks source link

collections.abc inheritance for simdjson.Object and simdjson.Array #77

Closed chutz closed 3 years ago

chutz commented 3 years ago

It would frequently be useful if these objects inherited from the standard collections abstract classes, that way generic isinstance tests could work as expected.

My suggestions:

I could probably take a stab at this if it's something that would be accepted.

TkTech commented 3 years ago

See the changes in #74. Specifically,

I originally wanted the same as you, but if you're using Array and Object as you would a list and dict you're not using them efficiently.

TkTech commented 3 years ago

Since there's been no further discussion around this, I'm going to ahead and close it but feel free to re-open if you think you have a good way to mix behaviours without encouraging poor performance. I'd definitely like for them to be ABC subclasses if we can get away with it!