|
|
|
|
|
by williamstein
3928 days ago
|
|
Sometimes it does. For example if you write a simple O(n) for loop in Python, then convert it to Cython, then compile it, the compiler may replace the for loop by an equivalent O(1) algorithm. I use this to surprise students when benchmarking Cython code for teaching purposes in my SageMath course. |
|
When you need to wrap some c code, or use high-level data structures (that cython handles beautifully with STL integration) that's when it makes sense to drop to Cython.