Skip to content

Remove types from docstrings #627

@DaniBodor

Description

@DaniBodor

According to the Google convention, functions with type hinted arguments do not need to have the types inside the docstring (see example below). I think the same is true for whether or not they are optional.

Currently, most of our docstrings do have the types (and optionality) annotated, despite them all being type hinted already. This makes them a bit clunky and lengthy.

Do we want to update these or leave them as is?

def function_with_pep484_type_annotations(param1: int, param2: str) -> bool:
    """Example function with PEP 484 type annotations.

    Args:
        param1: The first parameter.
        param2: The second parameter.

    Returns:
        The return value. True for success, False otherwise.
    """

Metadata

Metadata

Assignees

Labels

docsImprovements or additions to documentation

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions