Help is available in a standard IPython shell via the help command or by using the ? character. For example, for help on the built-in sum function, either of the below commands in an IPython shell could be used.
In [1]: help(sum)
Help on built-in function sum in module builtin:
...
In [2]: sum?
Signature: sum(iterable, start=0, /)
Docstring: ...
I want to have the same functionality in an ipdb debugger. One enters an ipdb debugger by placing the below code at the location for a debug breakpoint.
from ipdb import set_trace
set_trace()
However, once inside the ipdb debugger the Help functions no longer work.
ipdb> help(sum)
*** No help for '(sum)'
ipdb> sum?
*** SyntaxError: invalid syntax
ipdb>
Help in IPython shell and ipdb debugger
The below command represents a way to print a docstring inside the ipdb debugger, however this is not exactly the same functionality as help(sum) and sum? in the IPython shell.
ipdb> print(sum.__doc__)
How then do I get the same help functionality in an ipdb debugger that exists in the IPython shell?
help
, as that's a python builtin. – Stuccoworkhelp help
you may find useful. – Stuccowork