23

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?

James Draper
  • 5,110
  • 5
  • 40
  • 59
  • // , In the future, if you have questions about settings, you can search for them in the Settings search bar. In this case, you should have just searched `docstring`. – Nathan Basanese Mar 22 '18 at 07:44

1 Answers1

37

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

On Windows/Linux

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

On OS X

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

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

Docstring format

Andy
  • 49,085
  • 60
  • 166
  • 233