5 ms·
is cython compatible with all python code or is it only a subset of libraries that you can use?
by mlevental 8y ago
is cython compatible with all python code or is it only a subset of libraries that you can use?
- f311a 8y agoYou can import whatever you want, but it will work in "Python" mode.
- deathanatos 8y agoIt depends. This is the only deviation I've ever found: https://github.com/cython/cython/issues/1936 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.