For your documentation to display as well as the numpy number, you need to follow the NumpyDoc standard. Suppose you have a function called func with two arguments like this:
def func(arg1, arg2): return True
To add documentation to it, you need to write a multi-line string under its definition (called in the docstring of the Python world), for example
def func(arg1, arg2): """Summary line. Extended description of function. Parameters ---------- arg1 : int Description of arg1 arg2 : str Description of arg2 Returns ------- bool Description of return value Examples -------- >>> func(1, "a") True """ return True
What Spyder does is that it takes this simple text description, parses it and displays it as html, and finally shows it in the object inspector.
To see this, you just need to call func elsewhere in your code and press Ctrl + i next to it, for example:
func<Ctrl+i>(1, "a")
It also displays automatically when you write the left bracket next to func .
source share