[Cython] non-virtual methods
vitja.makarov at gmail.com
Tue Aug 30 18:39:45 CEST 2011
2011/8/30 Stefan Behnel <stefan_ml at behnel.de>:
> 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?
>>> class Foo:
>>> cpdef bar(self):
>>> 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.
Ok. So final class could have cpdef methods but non-final extension
type couldn't, am I right?
More information about the cython-devel