From e56d5ec6878cc59d38996d079a0d433621c41d66 Mon Sep 17 00:00:00 2001 From: nbruin Date: Wed, 10 Apr 2013 19:55:48 -0700 Subject: [PATCH] explain difference between cdef and cpdef --- docs/src/tutorial/clibraries.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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:: -- 2.7.4