Open dylanhmorris opened 1 month ago
@CDCgov/pyrenew-devs
My inclination has been to use both type annotations and type hints in the docstrings. Reasoning: Without the type hints, I would have to read the full docstring more often, so having the hint was a more efficient way to get a sense of the function or class, and without the docstring type annotations, the rendered documentation on the website seemed incomplete. If the rendered documentation is not too heavily compromised in utility were the type annotations removed, I would support the change.
From PEP 484. Confusingly the "annotation syntax" in this screenshot refer to type hints where the function is defined.
@AFg6K7h4fhy2 apologies, I should have clarified that it is possible to generate argument type documentation directly from type hints
@AFg6K7h4fhy2 apologies, I should have clarified that it is possible to generate argument type documentation directly from type hints
Np. If this is the case then I "lean yes" as well.
Context: it is possible to generate type information for Sphinx docs directly from type hints, rather than relying on docstrings. See https://github.com/tox-dev/sphinx-autodoc-typehints
I lean yes but want to hear what others think.
see e.g. https://github.com/executablebooks/MyST-Parser/issues/228#issuecomment-1449869862