On 2016-08-10 17:02, Travis Scrimshaw wrote:
However, this does have a problem that if we
don't enable them by default interactively, we get different output
behaviors.
We already have that for normal exceptions, where IPython does fancy
formatting of tracebacks.
Command-line:
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
<ipython-input-1-6f88eab09598> in <module>()
----> 1 Integer(1)/Integer(0)
/usr/local/src/sage-config/src/sage/rings/integer.pyx in
sage.rings.integer.Integer.__div__
(build/cythonized/sage/rings/integer.c:12743)()
1841 if type(left) is type(right):
1842 if mpz_sgn((<Integer>right).value) == 0:
-> 1843 raise ZeroDivisionError("rational division by zero")
1844 x = <Rational> Rational.__new__(Rational)
1845 mpq_div_zz(x.value, (<Integer>left).value,
(<Integer>right).value)
ZeroDivisionError: rational division by zero
Doctest:
Traceback (most recent call last):
File
"/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 499, in _run
self.compile_and_execute(example, compiler, test.globs)
File
"/usr/local/src/sage-config/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 862, in compile_and_execute
exec(compiled, globs)
File "<doctest sage.all._write_started_file[2]>", line 1, in <module>
Integer(1)/Integer(0)
File "sage/rings/integer.pyx", line 1843, in
sage.rings.integer.Integer.__div__
(build/cythonized/sage/rings/integer.c:12743)
raise ZeroDivisionError("rational division by zero")
ZeroDivisionError: rational division by zero
Nobody has ever complained about this. So I don't think that it's an
issue if warnings would look different in doctests.
Jeroen.
--
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.