13

If I add a docstring to a method using the triple-quote, as soon as I type a space after the triple-quote, PyCharm will populate the docstring with the parameters the method takes, and a return value, like so:

def fill_blank(self, direction):
    """ 
    :param direction: 
    :return:
    """ 

I've searched the PyCharm preferences for "docstring" and "stub" and turned off everything that shows up, even if it doesn't seem to pertain to this particular behavior; and I've googled high and low, but can't figure out how make it stop. Does anyone know how? (This is in PyCharm CE 3.4)

shanusmagnus
  • 2,340
  • 2
  • 20
  • 19

1 Answers1

22

You need to set the docstrings format to "Plain". It defaults to reStructuredText, which is giving you those hints.

The setting is found under Python Integrated Tools in your project settings.

  1. File > Settings
  2. Python Integrated Tools
  3. Docstring format

Screenshot

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284
  • Thanks! I had unchecked the checkbox, but would never have thought to change the type. – shanusmagnus Aug 03 '14 at 04:57
  • 1
    Hmm -- since the 2016 release, this is the default behavior. In fact, there seems to be no way to turn it on. – user48956 Apr 06 '16 at 17:44
  • 1
    user48956, did you ever find an answer to this? I'm trying to get the old docstring behavior back as well, but can't get it to work on Pycharm professional 2016. Seems like a bug. I love that feature – user2233949 Jul 15 '16 at 18:07
  • Go to settings->Editor->General->Smart Keys-> and uncheck "Insert pair quote" – user2682863 Oct 29 '16 at 00:55
  • user2682863, you're a life saver. I haven't been able to get PyCharm to insert the docstring template for months. Unchecking 'Insert Pair Quote' fixed it. Much appreciated. – user2233949 Jun 19 '17 at 19:31
  • 1
    Different path for Version 2019.3. File/Settings/Tools/Python Integrated Tools – Marc Condon Oct 02 '20 at 17:14