PDB (and other Python debuggers) have a simple way of viewing the value of any current variable, just by typing it in. However, sometimes I work with libraries that don't store their return values in intermediate variables.

Here's an example function:

def do_stuff(*args, **kwds):
     return f(*args, **kwds)

After I return from f, how do I see the return value? I could rewrite libraries after I download them to have an intermediate:

def do_stuff(*args, **kwds):
     r = f(*args, **kwds)
     return r

but it seems like there should be a better way.

Edit
Report