Ipdb documentation and methods

I need to analyze the methods of the external API and as I usually do this, to write a test script or find an example code, do

ipdb.set_trace() 

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

 object.method? 

I get

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

If i try

 help(object.method) 

He gives

 *** No help on (object.method) 

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

+6
source share
2 answers

The help() function is actually a wrapper around pydoc.help() , which means you can do something like:

 ipdb> import math ipdb> import pydoc ipdb> pydoc.help(math.log) 
+3
source

In fact !help(object.method) works, you just need to label with ! that this is a python command, not a help ipdb command. Although a convenient question mark does not work that way, unfortunately.

+6
source

Source: https://habr.com/ru/post/925553/


All Articles