[Python-ideas] The prohibition overrides the class method

Nick Coghlan ncoghlan at gmail.com
Tue Nov 17 21:41:29 EST 2015


On 18 November 2015 at 08:48, Michael Selik <mike at selik.org> wrote:
> Cython has a `final` for preventing a class from being overridden
> (http://docs.cython.org/src/userguide/extension_types.html#subclassing). I
> don't know if Cython supports `final` methods outside of final classes. They
> might be more interested in implementing that feature.

+1, as a lot of Cython's power comes from allowing developers to
deliberately (and selectively) *opt out* of Python's dynamic features.
They even provide an annotation mode that shows how far you've
progressed in rendering a section of code entirely static:
http://docs.cython.org/src/quickstart/cythonize.html#determining-where-to-add-types

Regards,
Nick.

P.S. For folks interested in learning more about that, I'd recommend
Caleb Hattingh's PyCon Australia talk about using Cython to speed up
and parallelise code hotspots:
http://docs.cython.org/src/quickstart/cythonize.html#determining-where-to-add-types

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list