sphinx-contrib / napoleon

Other
149 stars 48 forks source link

Variant types in docstrings #1

Open eaaltonen opened 6 years ago

eaaltonen commented 6 years ago

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.

McSinyx commented 4 years ago

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