Hello, > Since we can already detect doctests, and among those we can already detect > the various doctest flags, we should be able to hide those flags. The TESTS > blocks are a different situation. If we insist that TESTS blocks are always > the last thing in the docstring, I can imagine it working.
There are cases where this would be wrong: I saw some code whose 'references' appeared after a test block. However, that should not be very hard to check manually, so that we could make sure that we first fix all such occurrences. While I don't have much technical knowledge of our testing mechanisms, I would be tempted to say that the way we filter the doctests is with some 'ugly grep'. This, to say that I am not sure that we currently have any notion of 'example block' or 'example environment'. Additionally, this filtering is done through introspection (not sure, but that would explain why we can't doctest cdef functions). I.e. the doctest code loeds all functions and parses its content. In order to only display a reduced version of the docstring to the user we would have to parse and change the docstring when the function is defined, or perhaps (better) when the user asks for the doc (though I don't know how that would work at the moment). In simpler terms, we need to insert some program between the doctest and the user who wants to read it. Which is not something that the doctests scripts do. I should have said sufficiently many erroneous things to let everybody who's willing come and dispute me on specific points. I should stop here. Perhaps I should add, just in case, that I also believe that this would be a nice addition. The reason why we have 'tests' blocks is that some of our tests are not meant to be understood by users, or might even scare them if they saw the complicated codes. Nathann -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
