Lisandro Dalcin, 31.10.2010 08:22: > On 31 October 2010 10:09, Robert Bradshaw wrote: >> What about using the >> >> [cdef] class A: >> ... >> >> del A >> >> idiom that people use for pure Python? > > I have to admit that this looks even simpler.
Emphasis on "looks". I can see this easily working for Python classes, but what would be the semantics for cdef classes? Would it have any impact on their accessibility from Cython, and more specifically, from inside of the module that defines the type? What if a user externally overrides a Python class as cdef class in pure mode? And would it (or should it ever) be possible to redefine the type after deleting it? Should Cython prevent this for public/api classes, or would you just get the ImportError at runtime when it tries to read the type from the module dict? Or would you just say "well, it's not really 'del' what's happening here, it's something that looks like Python, doesn't have an immediate impact, but removes the name from something that you can't see in your code"? The advantage of a decorator is that it's easy to get right, to read and comprehend. I'm not really opposed to using "del" here, but I'm not sure I can oversee all the implications of allowing it on cdef types. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
