3 ms·
Considering that Python 3 remains slower than Python 2 on many benchmarks, what you're suggesting would be an interesting feature for Cython/Python 3 -- "Compil
by dr_zoidberg 11y ago
Considering that Python 3 remains slower than Python 2 on many benchmarks, what you're suggesting would be an interesting feature for Cython/Python 3 -- "Compile your Python 3 code with Cython and get 100%* speedup (*on average)".
However, as I understand, Py3's type hints are derived from a previously available module (which I think also worked with Py2). So why would they add compatibility for that now? Why not just write your own parser that reads types annotations and then outputs Cython-equivalent variables declartions?
There are also some Cython specific types that you won't find, for example the functions can be either cdef or cpdef, depending if you plan to use them from C only, or C and Python.
I still see value in learning Cython as a complement to Python, for the cases where you need to get "closer to the metal". It's not so much more, and it helps a lot in performance.