When information about a type is needed you can use:
my_list = []
dir(my_list)
gets:
[\'__add__\', \'__class__\', \'__conta
Try
help(my_list)
to get built-in help messages.
Or
help(list.append)
if you're generally poking around.
You can use pydoc
.
Open your terminal and type python -m pydoc list.append
The advantage of pydoc
over help()
is that you do not have to import a module to look at its help text.
For instance python -m pydoc random.randint
.
Also you can start an HTTP server to interactively browse documentation by typing python -m pydoc -b
(python 3)
For more information python -m pydoc
In python: help(my_list.append)
for example, will give you the docstring of the function.
>>> my_list = []
>>> help(my_list.append)
Help on built-in function append:
append(...)
L.append(object) -- append object to end