In the Cython docs there is an example where they give two ways of writing a C/Python hybrid method. An explicit one with a cdef for fast C access and a wrapper def for acce
See docs here - for most purposes they are practically the same, cpdef has slightly more overhead but plays nicer with inheritance.
The directive cpdef makes two versions of the method available; one fast for use from Cython and one slower for use from Python. Then:
This does slightly more than providing a python wrapper for a cdef method: unlike a cdef method, a cpdef method is fully overridable by methods and instance attributes in Python subclasses. It adds a little calling overhead compared to a cdef method.