Hacker News new | past | comments | ask | show | jobs | submit login

is cython compatible with all python code or is it only a subset of libraries that you can use?



It depends. This is the only deviation I've ever found: https://github.com/cython/cython/issues/1936 ; that is, Cython will execute __prepare__ in Python 2; but __prepare__ doesn't exist in Python 2, so the normal interpreter (CPython) won't execute it. This can lead to deviations; in my case, the code crashes if run under Cython, and executes fine under CPython.

The Cython maintainers disagree with me that this is a bug, so, if you're under Python 2, I would say it is "very nearly" compatible. If you're in a recent version 3, AFAICT, it just makes Python code faster.


You can import whatever you want, but it will work in "Python" mode.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: