Open titusz opened 4 months ago
Hi! We definitely support type hints :) don't hesitate to open issues with minimal reproducible examples in our bug tracker ^^
Ah, sorry, I read type hints instead of type comments. We don't support comments indeed.
What I like about PEP 484 type comments for function annotations is that they can make many function signatures much more readable. For example:
def process_data(raw_data: List[Dict[str, str]], config: Optional[Dict[str, str]] = None) -> List[int]:
"""Process raw data according to config."""
pass
becomes:
def process_data(raw_data, config=None):
# type: (List[Dict[str, str]], Optional[Dict[str, str]]) -> List[int]
"""Process raw data according to config."""
pass
And type comment based function annotations are well supported by mypy and IDEs like PyCharm. @pawamoy Do you think that would be something to consider to support with griffe?
Fortunately, ast
can parse type comments, so we can consider supporting them. Not a priority though since we have type annotations. Could be an Insiders feature :)
mkdocstrings does not seem to support PEP 484 type comments