Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Any reason not to use cpdef for every Cython function?

From http://docs.cython.org/src/userguide/language_basics.html

Within a Cython module, Python functions and C functions can call each other freely, but only Python functions can be called from outside the module by interpreted Python code. So, any functions that you want to “export” from your Cython module must be declared as Python functions using def. There is also a hybrid function, called cpdef. A cpdef can be called from anywhere, but uses the faster C calling conventions when being called from other Cython code.

So what's the catch?