On Sat, Oct 30, 2010 at 2:12 PM, Lisandro Dalcin <[email protected]> wrote: > On 30 October 2010 22:16, Stefan Behnel <[email protected]> wrote: >> Hi, >> >> a while ago, we had agreed that a "final" directive would be nice to have >> for cdef classes. I implemented the basics for that (i.e. "final" types are >> no longer subclassable from Python), and I also added an "internal" >> directive that prevents a type from appearing in the module dict. So you >> can now write something like this for a type that you only use internally >> in your module: >> >> �[email protected] >> �[email protected] >> cdef class _MyInternalType: >> ... >> >> http://trac.cython.org/cython_trac/ticket/263 >> http://trac.cython.org/cython_trac/ticket/585 >> > > Many thanks for this, Stefan! > >> I think the "final" directive name was pretty much agreed on, but what >> about the "internal" directive? Any objections to that? >> > > Perhaps "private" ? I still prefer "internal".
I'd lean towards "private" but that's not a strong preference. I also don't think such a feature is strictly necessary and complicates the language, but wouldn't stand in its way if I'm the only one. >> There are currently no optimisations for final types, but that may come in >> the future. >> >> BTW, since I expect that both will not be features that users deploy all >> over the place (and I actually think that "final" should be used with some >> care), I didn't add a modifier to the parser syntax. It's currently a pure >> directive. And I would prefer leaving it that way. >> > > I agree, +1 for the current implementation. +1 from me too. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
