Re: allow doctesting framework to parse lines with "....:"

Skip to first unread message
Message has been deleted


Dec 14, 2010, 12:44:52 PM12/14/10
to sage-devel
On 14 Dez., 14:02, Minh Nguyen <> wrote:
> At ticket #10458 [1] is a patch that allows the doctesting framework
> to deal with doctest lines that begin with "....:". Such a line is
> exactly what you would get if you work with IPython. By default
> IPython prints out "....:" for line continuation, as compared to the
> Python shell which prints "...". I suggested on the ticket that we
> need to configure or patch IPython to get it to use "...", rather than
> change the doctesting framework code to allow it to parse lines with
> "....:". With the said patch at #10458, you could now include doctests
> such as the following in a Sage module:
> sage: statement-more-statement
> ....: more-statements
> Any thoughts on this issue?

IMHO we should use the (over-due) fix made by the current patch at the

Patching IPython (and/or maybe rather than our
doctesting framework for that purpose doesn't make sense to me.

We already replace "sage: " by ">>> ", so why not also replace "....:
" by "... ", which the patch does?

We still have to fix losing the non-preparsed (i.e. verbatim Sage
input) source code of *continuation* lines, which is passed to Python
in end-of-line comments.


Keshav Kini

Dec 14, 2010, 1:32:00 PM12/14/10
to sage-devel

I'm the creator of the patch and reporter of the trac ticket. I'd just
like to mention that the patch I uploaded is only a quick hack to make
sage pass the test file I had written (which is also uploaded to the
trac ticket). I have little experience with sage on the whole, and
less with the doctest framework, so I hope someone with some
familiarity with sage doctests or who was involved in coding them can
take a look at and perhaps improve my patch. For example my change to
line 613 is a bit reckless...

Reply all
Reply to author
0 new messages