Stefan Behnel, 31.10.2010 08:27: > Stefan Behnel, 30.10.2010 21:16: >> can now write something like this for a type that you only use internally >> in your module: >> >> @cython.final >> @cython.internal >> cdef class _MyInternalType: >> ... > > One problem I spotted was the auto test dict (again). It takes the classes > from the module dict if they have a docstring, which now fails for internal > types (it would also fail for 'del'-ed types, BTW). I always wondered why > it used the module dict anyway - I guess it's just simplicity. Any reason > not to rewrite that?
I simplified it now to use the compile time docstrings directly, instead of looking them up at runtime. I don't think this breaks anything important, as the docstrings of functions and methods cannot be modified anyway. On the plus side, it removes a *ton* of ugly C code, and also saves some time during module initialisation. The only visible thing that changes is when a decorator covers a function with another one that has a different docstring, as the original docstring will remain in the test dict. But this is a) rare (people usually go to great length trying to *make* the new function look like the old one) and b) something you can fix by disabling the __test__ dict generation. It's just a helpful feature, after all, not a base-level requirement for using Cython. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
