Python Forum

Full Version: traceback and multi-line statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
IMHO a traceback should show more (within reason) of statements that are spread over multiple lines, and give the line numbers (first to almost last), as well. it currently only shows the first line (with any comments).

what do you think?

want code? here is my test script. you know how to get your own output.
def fun1(ugh):
    xyzzy = 'bar'
    raise ValueError( # comment one
        'oops'
        # comment two
        ' '
        f"foo"

        ' '
        f'{xyzzy} {ugh}'
        )

fun1('xyz')
exit('nope')