Aug. 30, 2011
9:33 a.m.
Robert Bradshaw, 30.08.2011 18:18:
On Tue, Aug 30, 2011 at 9:14 AM, Vitja Makarov wrote:
What about final classes with cpdef methods?
@cython.final class Foo: cpdef bar(self): pass
Should that raise an error?
That should be perfectly fine.
Well, the 'final' decorator shouldn't work on normal Python classes. Regarding extension types, CPython has a way of declaring them 'final' with a type flag, which effectively prevents them from being subclassed in Python. So the above works as just fine for cdef classes. Stefan