Если вы хотите следовать стилю numy docstring, есть несколько примеров от numpy, которые показывают, как описываются параметры функции:
1)
apply_along_axis(func1d, axis, arr, *args, **kwargs)
...
Parameters
----------
func1d : function (M,) -> (Nj...)
This function should accept 1-D arrays. It is applied to 1-D
slices of `arr` along the specified axis.
2)
apply_over_axes(func, a, axes)
...
Parameters
----------
func : function
This function must take two arguments, `func(a, axis)`.
3)
set_string_function(f, repr=True)
...
Parameters
----------
f : function or None
Function to be used to pretty print arrays. The function should expect
a single array argument and return a string of the representation of
the array. If None, the function is reset to the default NumPy function
to print arrays.
TLDR: они описаны вручную, без какого-либо специального синтаксиса или рекомендаций.Если ваша цель - создать строки документов, похожие на numpy, вы можете описать их любым способом.Но я настоятельно рекомендую выполнить @ jfaccioni answer и использовать подсказки типа.