[Python-ideas] Logical tracebacks

Andre Roberge andre.roberge at gmail.com
Mon Apr 15 17:00:58 EDT 2019


On Mon, Apr 15, 2019 at 5:07 PM Antoine Pitrou <solipsis at pitrou.net> wrote:

>
> Hello,
>
> I apologize because I'm only going to throw a very vague idea and I
> don't currently have time or motivation to explore it myself.  But I
> think it may prove interesting for other people and perhaps spur some
> concrete actionable proposal.
>
> With the growing complexity of Python software stacks, the length of
> tracebacks is continuously growing and is frequently making debugging
> errors and issues more tedious than it should be.  This is a
> language-agnostic problem.  Java software is often mocked for its
> ridiculously long tracebacks, but Python might come close in the future.
>
> Especially since Python is often the a language of choice for non
> computer science professionals, including but not only as a teaching
> language, this would be a problem worth solving.


For the "teaching" aspect, I have just started about a week ago working on
a project which aims
to produce more useful tracebacks for beginners. (This work builds from a
slightly different
project I had started quite a bit earlier.)

For example, you can see some "simplified" tracebacks for general
exceptions:

https://aroberge.github.io/friendly-traceback/docs/html/tracebacks_en.html

as well as for the not very informative "SyntaxError: invalid syntax".

https://aroberge.github.io/friendly-traceback/docs/html/syntax_tracebacks_en.html


If you go to these links, you will see on the following pages a version of
the
same but translated into French.  For those that read only the English
version,
you may find that it is sometimes repetitive.
However, the original message included in a traceback
is shown "as is", and is later rewritten in a way meant to be translated:
there is
no such duplication in languages other than English.

Ultimately, one could translate these in any language.
My ultimate goal is to provide similar simplified explanations for all
standard
exceptions in Python, including some that are specific to specialized
modules
(Turtle and Decimal come to mind), as well as providing an easy way
for Library writers to hook into this framework.

This does not address the full problem you raise, but I thought it might
provide
an additional viewpoint to this discussion.


> This would need a lot more thinking, and perhaps exploring what kind of
> hacks already exist in the wild to achieve similar functionality.
>

I guess my project could be thought of as one of these hacks.

André

Again, I'm just throwing this around for others to play with.
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190415/3f9a4dfc/attachment.html>


More information about the Python-ideas mailing list