Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow final methods in non-final cdef classes #1350

Open
robertwb opened this issue Nov 24, 2012 · 0 comments
Open

Allow final methods in non-final cdef classes #1350

robertwb opened this issue Nov 24, 2012 · 0 comments

Comments

@robertwb
Copy link
Contributor

robertwb commented Nov 24, 2012

In Cython 0.17.2, the following

cdef class Foo:
    cpdef inline bar(self):
        pass

fails to compile with an ''Only final types can have final Python (def/cpdef) methods'' error.

Ticket http://trac.cython.org/ticket/586: ''Support "final" methods in non-final cdef classes'' suggests that this should work, though. Said ticket also implemented an ''Overriding final methods is not allowed'' error which would be the expected result if one were to override a final method.

Robert Bradshaw wrote (https://groups.google.com/d/msg/cython-users/UuQvpvdNhjc/DILSEQvOun4J): The issue is how to prevent them from being overridden in Python (which is not unsolveable, could probably be done pretty easily with a metaclass). It's intentional that we disallow it before such a mechanism is in place

Migrated from http://trac.cython.org/ticket/795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant