Jeroen Demeyer
unread,Aug 9, 2017, 6:12:02 AM8/9/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython-users
Cython seems to allow this:
cdef class Base:
cpdef meth(self):
pass
cdef class Derived(Base):
cpdef meth(self, arg=None):
pass
cdef class MoreDerived(Derived):
cpdef meth(self, arg=None, arg2=None):
pass
It is important that the additional argument "arg" is optional,
otherwise Cython gives an error "Signature not compatible with previous
declaration".
Now, I have two questions:
1) Does the above really work?
2) When adding a .pxd file, is it required to redeclare the cpdef method
in Derived and MoreDerived? When I don't, I get a warning "Compatible
but non-identical C method ... not redeclared". I want to know whether
this warning is justified.