Skip to content

Preferred docstring style #7471

@bluetech

Description

@bluetech

pytest uses various docstring styles, which also leaks to the documentation, and I'm starting to develop an OCD from this!

I propose we use this style:

def func(arg: ArgType) -> Foo:
    """Do important stuff.

    More detailed info here, in separate paragraphs from the subject line.

    Use proper sentences -- start sentences with capital letters and end with periods.

    Can include annotated documentation:

    :param ArgType arg: an argument which determines stuff.
    :returns the result.
    :rtype Foo
    :raises ValueError
    """

After we agree on a style I'll make a sweep over the code (possibly gradual) to update to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: docsdocumentation improvement, missing or needing clarificationtype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions