On Tue, Nov 2, 2010 at 4:17 AM, Lisandro Dalcin <[email protected]> wrote: > On 2 November 2010 11:49, Stefan Behnel <[email protected]> wrote: >> Robert Bradshaw, 01.11.2010 21:44: >>> On Sun, Oct 31, 2010 at 11:38 AM, Stefan Behnel wrote: >>>>> One problem I spotted was the auto test dict (again). >>>> >>>> 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. >>> >>> Excellent! I've been wanting to do this myself, eventually when I >>> found the time. This means that cdef methods could have tested >>> docstrings as well (though, of course, they couldn't be called >>> directly). >> >> That was easy to implement, so I tried it. In lxml.etree, it adds some 10KB >> to the size of the module source code as the docstrings of cdef functions >> wouldn't otherwise end up there. Personally, I'm not sure it's worth it. If >> you can't call a cdef function/method from a doctest directly, why not just >> move the doctest itself to the function or method that you would have to >> call anyway? >> > > I agree with Stefan.
Sometimes I have a doctest in, e.g., a class body docstring to (indirectly) test a cdef method. Not common though. On this note, would it be easy/feasible to only insert docstrings that actually have tests in them? - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
