When I create a function with parameters, PyCharm offers me to create the docstring with :param param_name:
field, which is pretty good. But I also need to add the :type param_name:
.
So from that :
def foo(bar, xyz):
return bar + xyz
With the generate docstring option i have that (even with Insert 'type' and 'rtype' to the documentation stub enable) :
def foo(bar, xyz):
"""
:param bar:
:param xyz:
"""
return bar + xyz
And I would like that :
def foo(bar, xyz):
"""
:param bar:
:type bar:
:param xyz:
:type xyz:
"""
return bar + xyz
Per the documentation:
Following the link:
Once you have done this, put the cursor in a parameter name in the definition, activate the Smart Keys feature (Alt+Enter, by default) and select Specify type for reference in docstring. This will insert the appropriate comment line . Similarly you can put the cursor in the function/method name and select Specify return type in docstring.
Just enable this checkbox:
Also remember to enable this item so that u can use the Alt+enter to auto insert documentation: