napoleon icon indicating copy to clipboard operation
napoleon copied to clipboard

Variant types in docstrings

Open eaaltonen opened this issue 6 years ago • 1 comments

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.

eaaltonen avatar Apr 13 '18 11:04 eaaltonen

Hi, with PEP 484 in mind, this can be documented as Optional[float].

McSinyx avatar Apr 09 '20 09:04 McSinyx