Correct traceback for multiline chain of method calling

Артем Комендантян komendantyan.artem at gmail.com
Fri Jul 9 11:29:12 EDT 2021


Hello!

There is a code https://pastebin.com/0NLsHuLa.
It has a multiline chain of method calling, when some method fails. In
python3.7 it fails in a row which corresponds to the failing method, in
python3.9 it corresponds to the very first line.

Another similar example is https://pastebin.com/2P9snnMn
The error is on the first line for older pythons too.

I propose to have a line with the method name in traceback if this method
fails.

I develop some library when it is very popular among users to declare some
operations with such multiline chains. Also I want to keep correct
traceback for each operation because the first line is not very informative
when some method occurred more than once in this chain.

Can this improvement be done? Maybe anybody has any other suggestions on
how to get the correct line in traceback right now?


--
Best wishes,
Artem Komendantian
komendantyan.artem at gmail.com


More information about the Python-list mailing list