Reputation: 63062
I have enabled Insert documentation comment stub within Editor | General |Smart keys
:
But then how to get the method parameters type stubs? Adding the docstring triple quotes and then enter does open up the docstring - but with nothing in it:
def get_self_join_clause(self, df, alias1='o', alias2 = 'n'):
"""
""" # pycharm added this automatically
Upvotes: 1
Views: 533
Reputation: 12880
how to get the method parameters type stubs?
PyCharm does generate the docstring stub with the type placeholders, but the placeholders aren't currently (using PyCharm 2022.1) populated from the __annotations__
with the types. This has been marked with the state "To be discussed" in the JetBrains bugtracker, see issues PY-23400 and PY-54930.
Inclusion of the type placeholders is configured by checking File
>
Settings
>
Editor
>
General
>
Smart Keys
>
Python
>
Insert type placeholders in the documentation comment stub
.
It's worth noting the insert docstring stub intention is selected on the function name itself
In this example with Napoleon style docstring format selected in File
>
Settings
>
Tools
>
Python Integrated Tools
>
Docstrings
, the result:
Upvotes: 1