Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Leobouloc opened this issue Aug 10, 2023 · 1 comment
Open

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

Leobouloc opened this issue Aug 10, 2023 · 1 comment

Comments

@Leobouloc
Copy link
Contributor

Leobouloc commented Aug 10, 2023

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

@Leobouloc Leobouloc changed the title 📝(documentation) Remove types from doctrings ? 📝(documentation) Remove redundant types from doctrings ? Aug 10, 2023
@quitterie-lcs quitterie-lcs changed the title 📝(documentation) Remove redundant types from doctrings ? 📝(documentation) Remove redundant types from docstrings ? Aug 16, 2023
@quitterie-lcs
Copy link
Member

That's a good improvement ! Until now, the application of Google convention for docstrings oriented us to have types in docstrings, but we can change in a future step the docstrings to fit with PEP484 soon applied in ralph code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants