Comment by srean
14 hours ago
If you want different parts of your code to be a statically typed Python lookalike Cython is a mature option
14 hours ago
If you want different parts of your code to be a statically typed Python lookalike Cython is a mature option
Yes, it's mature, but you (and your potential audience) basically need to learn a new language, a lot of quirks and "weird" (I'd even say counter-intuitive) nuances, and it's also significantly less readable in comparison with strict and typed Python. Even its modern syntax doesn't click immediately (also performance wise the new syntax somehow is a bit slower in my tests)
I am by no means a Cython fanboy but I think you are exaggerating the syntactic differences and readability differences.
Apart from type annotation they are very minor, well worth the speed benefits and type-error benefits. Given that we are discussing it in the context of SPy, SPy is not fully compatible with Python either, which is quite understandable and in my opinion a Good trade-off.
The benchmarking features are great, interactivity with C libraries is great.
One annoyance I have with Cython though is debuggability. But it's an annoyance, not a show-stopper.
Have used in production without problems.