#14466: issue with type in doctests
-------------------------------------+--------------------------------------
Reporter: zimmerma | Owner: roed
Type: defect | Status: new
Priority: major | Milestone: sage-5.10
Component: doctest framework | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Comment (by nbruin):
Replying to [comment:4 zimmerma]:
> David, maybe I should explain the context: in our book in french about
Sage, we give examples of Sage code that are both printed in the book, and
also used to generate doctests (to ensure those
> examples will still run with future versions of Sage).
Do you mean that book has already been printed? I'd say you can just
update the book (immediately for the online version; in the next edition
for a printed version, if that exists) to work correctly.
I think we've had a very small window where the new IPython has been
printing different `type` representations.
It's pretty clear to me that we want to ensure that our doctests test the
same output as produced by an interactive session (they are documentation
as well as tests!).
The string `<type '...'>` is the straight `str` of a type. Changing the
doctest framework to test against anything else in a robust way means that
we'd have to change the doctest framework so that any return value gets
passed through the same print hooks that IPython offers.
The alternative seems much easier: Change IPython to (mostly) just produce
the straight `str` or `repr`.
> Thus we want that the result "Got" in doctests matches what we get in an
interactive session.
Which we can accomplish by ensuring that the interactive session does give
the same result as it did a while ago. Are you particularly married to
this new, modified interactive result we're getting due to the IPython
upgrade?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14466#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.