Category : docstring

Let’s consider the following example: class MyClass: def __init__(self): self._x = None @property def x(self) -> Union[float, np.ndarray]: if len(self._x) == 1: return self._x[0] else: return self._x @x.setter def x(self, value: Union[float, list, np.ndarray]): self._x = np.atleast_1d(value) Any suggestion on how can I properly document the above code? I am using Sphinx and numpydoc. Thanks ..

Read more

I’m looking for a tool that adds the type annotation that are already added in a function to the docstring generated by PyCharm. I have been following this https://youtrack.jetbrains.com/issue/PY-32837 for a long time and no progress seem to be made on this ticket yet. I saw this article as well https://towardsdatascience.com/python-type-hints-docstrings-7ec7f6d3416b but it seems too ..

Read more

The Google docstring styleguide for python writes You should not document exceptions that get raised if the API specified in the docstring is violated (because this would paradoxically make behavior under violation of the API part of the API). I want to confirm my understanding by asking the following question. If I indicate in the ..

Read more