You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
"""
The text was updated successfully, but these errors were encountered:
Leobouloc
changed the title
📝(documentation) Remove types from doctrings ?
📝(documentation) Remove redundant types from doctrings ?
Aug 10, 2023
quitterie-lcs
changed the title
📝(documentation) Remove redundant types from doctrings ?
📝(documentation) Remove redundant types from docstrings ?
Aug 16, 2023
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
Feature Request
Current doctstrings might include an
Args
section where parameters have type information (eganumber (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:
This post discusses this question:
https://stackoverflow.com/questions/69322595/duplicate-information-in-typing-and-docstring
The text was updated successfully, but these errors were encountered: