This is a common pattern to enrich an exception with more information:
def foo(x):
try:
bar(x)
except Exception as e:
raise ValueError("foo(): bar failed") from e
def bar(x):
1/x
This is common when a second exception occurs during exception handling:
def foo(x):
try:
bar(x)
except Exception as e:
raise ValueError("some other error")
def bar(x):
1/x
In both cases, ipdb (and pdb) wont let us step up the stack from to find the error in bar. While python 3.11 has Exception.add_note, there will continue to be lots of code using the methods above (and its not always practical to use this).
Example:

Can we enhance ipdb to handle both cases?
This is a common pattern to enrich an exception with more information:
This is common when a second exception occurs during exception handling:
In both cases, ipdb (and pdb) wont let us step up the stack from to find the error in
bar. While python 3.11 has Exception.add_note, there will continue to be lots of code using the methods above (and its not always practical to use this).Example:

Can we enhance ipdb to handle both cases?