Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ipdb and method documentation

I have to analyze methods a foreign API, and how I usually do it it to write a test script, or find an example code, do a

ipdb.set_trace()

Where I want to experiment, and than take a look at currently available variables, objects and their methods. However, when I want to check the documentation the way Ipython offers

object.method?

I get

*** SyntaxError: invalid syntax (<stdin>, line 1)

If I try

help(object.method)

It gives

*** No help on (object.method)

Does that mean that there is no documentation for the selected method, or am I using the wrong way of calling it?

like image 509
TheMeaningfulEngineer Avatar asked Sep 17 '12 08:09

TheMeaningfulEngineer


People also ask

What does IPDB mean?

ipdb, the IPython-enabled Python Debugger, is a third party interative debugger with all pdb's functionality and adds IPython support for the interactive shell, like tab completion, color support, magic functions and much more. You use ipdb just as you use pdb but with an enhanced user experience.

How do I get out of IPDB?

If you enter pdb interactive mode there is no way to return to ipdb or ipython. The proper way to exit is by using ctrl-d .

What is IPDB in Python?

ipdb exports functions to access the IPython debugger, which features tab completion, syntax highlighting, better tracebacks, better introspection with the same interface as the pdb module. Example usage: import ipdb ipdb.

How do I skip a line in IPDB?

It's like a next except that when a jump occurs to a previous line number for the loop, it will continue until exiting the loop. In general, to "step out" of the current function, use return . r(eturn) Continue execution until the current function returns.


1 Answers

Actually !help(object.method) works, you just need to signify with ! that it's a python command, not ipdb help command. Though convenient question mark doesn't work that way unfortunately.

like image 90
bravmi Avatar answered Sep 21 '22 15:09

bravmi