napoleon
napoleon copied to clipboard
Variant types in docstrings
I just encountered a need to declare a variant return type, roughly as follows:
Returns
-------
float or None
Description of return value
This does produce reasonable output, but I see it would be beneficial if the documentation gives some recommendation regarding variant types.
Hi, with PEP 484 in mind, this can be documented as Optional[float]
.