Skip to content

📝(documentation) Remove redundant types from docstrings ? #411

@Leobouloc

Description

@Leobouloc

Feature Request

Current doctstrings might include an Args section where parameters have type information (eg anumber (int): a number). Since we aim to add type hints to all variables, this creates redundant information. For simplicity and maintanability, shouldn't we only use type hints for info relative to types ?

We would have something like:

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.
    """

This post discusses this question:
https://stackoverflow.com/questions/69322595/duplicate-information-in-typing-and-docstring

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions