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
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to