Search code examples
pythonpycharmdocstring

Pycharm documentation template


Pycharm presents me with the following template for a docstring:

    """

    :param var1: 
    :param var2: 
    """

for a function def func(var1,var2).

Why does Pycharm uses this template? Is there some PEP or (unwritten) convention that this is good style?


Solution

  • By default, Pycharm uses reStructuredText. The template can be changed in Settings → Tools → Python Integrated Tools. Currently, there are 5 styles available: Plain, Epytext, reStructuredText, NumPy, Google.

    PEP 287 proposes reStructuredText as a standard format for docstrings.