[issue42524] pdb access to return value

Romuald Brunet report at bugs.python.org
Tue Dec 1 10:13:18 EST 2020


New submission from Romuald Brunet <romuald.brunet at gmail.com>:

When using the pdb module, there is currently no way to easy access the current return value of the stack

This return value is accessed by the 'retval command'

I propose using the currently unused argument to allow storing the return value in the local variables, accessible via the debugger

For example:


    def foo():
        debugger()
        return ComplexObject()

    def bar():
        return foo()

(pdb) retval
<ComplexObject instance at 0x1234>
(pdb) retval zz
(pdb) zz.attribute
'some value'

----------
components: Library (Lib)
messages: 382259
nosy: Romuald
priority: normal
severity: normal
status: open
title: pdb access to return value
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42524>
_______________________________________


More information about the Python-bugs-list mailing list