John Ehresman
unread,May 24, 2025, 11:19:37 AMMay 24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython...@googlegroups.com
I can’t seem to override a method from a base class in a final derived class. For example —
The .pxd file:
import cython
cdef class Base:
cdef Virtual(self)
@cython.final
cdef class Derived(Base):
cdef Virtual(self)
The .py file:
class Base:
def Virtual(self):
return 1
class Derived(Base):
def Virtual(self):
return 2
The error I get when cythonizing is: Overriding final methods is not allowed and the line for the error is the def Virtual() in the Derived class. But, at least the way I think of it, I’m implementing the Virtual() method, not overriding it.
Is this a bug or due to some limitation that I’m not seeing?
Thanks,
John