New decorators for adding docstring infos from typing
- from docs_from_typing import
- rest_docs_from_typing
- numpy_docs_from_tying
from docs_from_typing import numpy_docs_from_typing
numpy_docs_from_typing
def foo(val: int, /, *, val_a: Optional[str] = "foo") -> int:
return val ** 2
if __name__ == '__main__':
print(help(foo))
will give
foo(val: int, /, *, val_a: Union[str, NoneType] = 'foo') -> int
Function foo
Parameters
----------
val : postional only argument of type int
val_a : keyword only argument of type str or NoneType
Default is foo
Returns
-------
int