Having a function like:
def foo(x: int) -> float: return float(x)
I would like to use a docstring of type NumPy, as shown below:
def foo(x: int) -> float: """ Parameters ---------- x Input parameter Returns ------- The output value. """ return float(x)
Note that:
- I do not want to specify the parameter type again.
- I do not want to specify the type of the return value again.
- I would like this extension to be able to read annotated types (and write them to the generated HTML documentation).
Is there an Sphinx extension that supports this? Would you recommend a different syntax?
python python-sphinx
Peque
source share