James Draper James Draper - 1 year ago 94
Python Question

How to change PyCharms doctring autocomplete

I have been programming in PyCharm for a little while now and I like it just fine however there is one little thing that is nagging at me, when I go to generate a new docstring for a function that I have defined PyCharm will autocomplete the docstring using what I believe is sphinx style formatting. Example in picture below:

PyCharm default docstring autocomplete

I'd like to change this format to something appear like the docstrings throughout the numpy module. Here is the beginning of the docstring for numpy.max for an example;

Docstring for numpy.max

Is there a way I can either A) quickly swap the PyCharm docstring autocomplete method or B) cumstomize the existing autocomplete method?

Answer Source

You can adjust this by going to the Python Integrated Tools settings.

On Windows/Linux

File -> Settings -> Tools -> Python Integrated Tools 


PyCharm -> Preferences -> Tools -> Python Integrated Tools

Then there is a Docstrings section. Change the drop down format to NumPy and press "OK"

Docstring format

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download