On 31/07/2018 05:57, Erik Bray wrote:
On Mon, Jul 30, 2018 at 8:34 PM Jeroen Demeyer <j.deme...@ugent.be> wrote:

On 2018-07-30 18:31, Erik Bray wrote:
This is a bit far-out, but what if we just didn't show tracebacks at
all by default?

Sorry to say, but that would be a horrible idea. Even if the tracebacks
are completely useless for ordinary users, they allow developers to
debug an issue when posted on a mailing list/asksage. I would avoid
anything that makes it harder for users to get help from developers.

I agree but if you read the rest of my message you would see that I
also suggested making it very easy to obtain the actual traceback
(even including instruction for doing so with every error).  That's no
harder--easier even--than what we already ask of users when give them
a path to the error log when Sage crashes on startup.

To be concrete, instead of seeing:

sage: 1 / 0
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-10-b43c99900d8f> in <module>()
----> 1 Integer(1) / Integer(0)

/home/embray/src/sagemath/sage-python3/local/lib/python3.6/site-packages/sage/structure/element.pyx
in sage.structure.element.Element.__truediv__
(build/cythonized/sage/structure/element.c:13020)()
    1729         cdef int cl = classify_elements(left, right)
    1730         if HAVE_SAME_PARENT(cl):
-> 1731             return (<Element>left)._div_(right)
    1732         if BOTH_ARE_ELEMENT(cl):
    1733             return coercion_model.bin_op(left, right, truediv)

/home/embray/src/sagemath/sage-python3/local/lib/python3.6/site-packages/sage/rings/integer.pyx
in sage.rings.integer.Integer._div_
(build/cythonized/sage/rings/integer.c:13584)()
    1952         """
    1953         if mpz_sgn((<Integer>right).value) == 0:
-> 1954             raise ZeroDivisionError("rational division by zero")
    1955         x = <Rational> Rational.__new__(Rational)
    1956         mpq_div_zz(x.value, self.value, (<Integer>right).value)

ZeroDivisionError: rational division by zero


users would see:

sage: 1 / 0
ZeroDivisionError: rational division by zero (enter %tb to see the
full error traceback)

I am +1 for this having this kind of behavior. There should also be
command line arguments to enable/disable this (perhaps --with-traceback
and --without-traceback). As for the default I don't really care since
the "sage" command on the system can be made anything.

As William noted this is already roughly the behavior on SageNB, so I
would wager that it's not a "horrible idea".

I would even call it a "good idea"!

Vincent

--
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.

Reply via email to