Developer
Developer

Reputation: 1

Is there a way to change the default docstring text generated by Spyder when creating a new function?

I am trying to change the default docstring text that Spyder generates when creating a new function. I like how I can automatically create a docstring template, but I wanted to change the text. If you don't know what I mean, here is the docstring Spyder generates:

def example_function(n):
    """


    Parameters
    ----------
    n : TYPE
        DESCRIPTION.

    Returns
    -------
    None.

    """

I would be grateful if anyone has a way to change this text. Thanks.

Upvotes: 0

Views: 1977

Answers (1)

Carlos Cordoba
Carlos Cordoba

Reputation: 34156

(Spyder maintainer here) There's no way to change the template text introduced by Spyder to create docstrings.

However, you can select between two different types of docstring formats (Numpy and Google) by going to the menu

Tools > Preferences > Editor > Advanced settings > Docstring type.

Upvotes: 3

Related Questions