[Cython] Virtual cpdef methods

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jun 20 18:14:17 EDT 2016


Robert Bradshaw wrote:
> All methods (cdef, cpdef, and def) are virtual by default in Cython,
> just like Python.
> 
> On Mon, Jun 20, 2016 at 6:08 AM, Jeroen Demeyer <jdemeyer at cage.ugent.be> wrote:
> 
>>I would like to have a "virtual" cpdef method: something which allows a fast
>>Cython call *when implemented* but without a default implementation.

It sounds like Jeroen really means "abstract" here, not "virtual".

The usual way to do this kind of thing in Python is to write
a stub method that raises NotImplementedError or such like.

-- 
Greg


More information about the cython-devel mailing list