From: nbruin Date: Thu, 11 Apr 2013 02:55:48 +0000 (-0700) Subject: explain difference between cdef and cpdef X-Git-Tag: 0.19b2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e56d5ec6878cc59d38996d079a0d433621c41d66;p=platform%2Fupstream%2Fpython-cython.git explain difference between cdef and cpdef --- diff --git a/docs/src/tutorial/clibraries.rst b/docs/src/tutorial/clibraries.rst index 72d8c0d..d085f2c 100644 --- a/docs/src/tutorial/clibraries.rst +++ b/docs/src/tutorial/clibraries.rst @@ -426,7 +426,10 @@ methods from ``cdef`` to ``cpdef``. This will let Cython generate two entry points, one that is callable from normal Python code using the Python call semantics and Python objects as arguments, and one that is callable from C code with fast C semantics and without requiring -intermediate argument conversion from or to Python types. +intermediate argument conversion from or to Python types. Note that ``cpdef`` +methods ensure that they can be appropriately overridden by Python +methods even when they are called from Cython. This adds a tiny overhead +compared to ``cdef`` methods. The following listing shows the complete implementation that uses ``cpdef`` methods where possible::