[Python-ideas] Shrink recursion error tracebacks (was: Have REPL print less by default)

Franklin? Lee leewangzhong+python at gmail.com
Sat Apr 23 20:44:27 EDT 2016


On Sat, Apr 23, 2016 at 6:13 AM, Steven D'Aprano <steve at pearwood.info> wrote:

> Just in case anyone missed it, here's my actual, working, code,

> I'm not very interested in a complex, untested, incomplete, non-working
> chunk of pseudo-code when I have something which actually works in less
> than twenty lines.

I'm not conjoined to the idea. I'm just proposing it as an
alternative. I provided the pseudocode to express an idea, so that the
idea could be discussed. I've already identified one glaring bug, but
the quality of pseudocode itself is not really important: if there are
actual implementation obstacles, they can be discussed _if_ the idea
is considered useful.

Remember that we're all here for the good of Python.


> So I'm afraid that, even if you manage to get your pseudo-code working
> and debugged, I'm going to vote a strong -1 on your proposal. Even if it
> works, I don't want lines to be hidden just because they've been seen
> before in some unrelated part of the traceback.

In a single callstack, there ARE no unrelated parts of the traceback.
They've been seen before because they are part of a cycle: they
started a call chain that eventually leads back to them.


> Especially since your version hides useful traceback
> information and requires the user to call a separate function to display
> the unmangled (and likely huge) traceback to find out what they're
> missing.

In fact, it would probably only hide useful information if there is a
non-trivial graph cycle. In that case, the RLE will still give the
unmangled (and likely huge) traceback.


More information about the Python-ideas mailing list