xarray icon indicating copy to clipboard operation
xarray copied to clipboard

Type annotation guidelines

Open Illviljan opened this issue 3 years ago • 2 comments

Dask has a pretty nice guideline for type hinting, see https://github.com/dask/community/issues/255.

Notable for us is to avoid adding typing in docstrings to avoid duplicating information.

Illviljan avatar Sep 18 '22 15:09 Illviljan

How exactly does it work with the automatic types in the docstring?

headtr1ck avatar Sep 21 '22 08:09 headtr1ck

How exactly does it work with the automatic types in the docstring?

Yes, what I really like in the html API documentation is the types (and especially the hyperlinks!) next to each name in the parameter list. Does napoleon support generating those links automatically from the typed signature?

Screenshot 2022-09-21 at 13 00 04

benbovy avatar Sep 21 '22 11:09 benbovy