[Python-ideas] Logical tracebacks
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:
> 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
project I had started quite a bit earlier.)
For example, you can see some "simplified" tracebacks for general
as well as for the not very informative "SyntaxError: invalid syntax".
If you go to these links, you will see on the following pages a version of
same but translated into French. For those that read only the English
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:
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
exceptions in Python, including some that are specific to specialized
(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
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.
Again, I'm just throwing this around for others to play with.
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas