Embracing Cython 3.0 pure python mode to speed-up the library
Recently, Cython released the 3.0 version with a Pure Python mode, and I think it would be a game changer in this library, as most of the code is just Python logic using basic types.
Having all the parsing and validation logic running at C speed would be awesome.
The only downside is the library would need to drop support for Python 2, but: is this really a piece of bad news?
I could help with the optimization.
Does supporting Cython just involve maintaining parallel .pxd files, similar to the .pyi files that already have parallel type information?
Also, why would Cython support require removal of Python 2 support?
There's also mypyc, which uses type hints to compile to C.
maintaining parallel .pxd files
It seems like Cython would work even absent the .pxd files, but adding them increases the information provided to Cython and hence the speed-up is greater.