3 ms·
Little bit off topic perhaps but why encode the types a second time in the comment when you already have the annotations?
by bruce343434 4y ago
Little bit off topic perhaps but why encode the types a second time in the comment when you already have the annotations?
- annowiki 4y agoIts a numpy style docstring. PyCharm can be configured to auto generate them. I guess I just add the types to be thorough. Ideally I want to generate api documentation via a tool. A long time ago I wrote a script to parse the AST and generate markdown from the docstrings and function information, but it was mediocre and I haven't wanted to use sphinx because its too heavy and doesn't seem to produce ideal markdown output. numpy seems to sometimes use type hints in the docstring, other times not: https://numpydoc.readthedocs.io/en/latest/format.html#parameters https://numpydoc.readthedocs.io/en/latest/format.html#parame...