On Mon, Jul 30, 2018 at 7:00 PM Nils Bruin <nbr...@sfu.ca> wrote: > > On Monday, July 30, 2018 at 9:31:21 AM UTC-7, Erik Bray wrote: >> >> On Sun, Jul 29, 2018 at 11:25 PM William Stein <wst...@gmail.com> wrote: >> > >> > On Sun, Jul 29, 2018 at 11:45 AM, Jeroen Demeyer <j.de...@ugent.be> wrote: >> > > On 2018-07-29 17:27, William Stein wrote: >> > >> >> > >> Even disentangling the preparser would help a lot... >> > > >> > > >> > > That's the second-oldest open ticket: >> > > https://trac.sagemath.org/ticket/71 >> > > >> > >> > Jeroen -- it looks like you actually implemented disentangling the >> > preparser in a branch on that ticket? >> >> This is a bit far-out, but what if we just didn't show tracebacks at >> all by default? Or at the very least, tracebacks originating from >> Sage itself? Then, for example, "1/0" will just give a >> ZeroDivisionError, not a full traceback deep somewhere into some >> Cython code. Very useful for developers and advanced >> users--positively terrifying and useless noise for new users and >> students not as familiar with Python. >> >> For their own code it's still good to have tracebacks as it is >> infinitely valuable in debugging, and that's where the un-preparsing >> might come in handy. But I'd hide Sage-originated tracebacks by >> default (perhaps with an easy syntax for re-enabling them, such as a >> %-magic, and instructions for how to do so accompanying every error). > > > Given that "%debug" works, it seems we're storing the traceback anyway. If we > hide it, we could simply have a %tb or %traceback to display the traceback. > There will be some limited scenarios where a traceback would normally find > its way to the terminal, but sage segfaults before the prompt is available. > In those cases we would lose information, but otherwise I'd be happy to type > %tb to get a traceback. > > In the notebook, we could do something fancy and fold the traceback, only > displaying the error message, but it would have to be a rock solid > implementation before that's worth it. > > Of course, in doctesting we do want the tracebacks.
prompt_toolkit is powerful-enough that traceback-folding could be done on the CLI as well. It would probably require a keyboard-shortcut of some kind to hide/show tracebacks, though for terminal emulators with good mouse support it could also be done with the mouse :) Easier said than done of course, but doable. -- 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.