If Jedi cannot correctly detect the type of a function argument due to Python's dynamic nature, you can provide hints using several styles.
Official Gradual Typing (Recommended)
Use PEP 484, PEP 526, or PEP 589 annotations. This is the most reliable method.
def myfunction(node: ProgramNode, foo: str) -> None:
"""Do something with a ``node``.
"""
node.| # complete here
Sphinx style
Use info-field lists in docstrings:
def myfunction(node, foo):
"""
Do something with a ``node``.
:type node: ProgramNode
:param str foo: foo parameter description
"""
node.| # complete here
Epydoc
Use @type in docstrings:
def myfunction(node):
"""
Do something with a ``node``.
@type node: ProgramNode
"""
node.| # complete here
Numpydoc
Requires the numpydoc package. Use the Parameters section in the docstring:
def foo(var1, var2, long_var_name='hi'):
r"""
A one-line summary...
Parameters
----------
var1 : array_like
Array_like means...
var2 : int
The type above...
long_variable_name : {'hi', 'ho'}, optional
Choices in brackets...
"""
var2.| # complete here