So far so good. But next I would like my rendered docstring to display whether a parameter is optional, i.e. has a default. In other words I want it to look like this:
This currently isn't possible.
The inclusion of types in the docstring is handled by the sphinx.ext.autodoc.typehints extension. So if you wanted this behaviour then you should request it in Sphinx.
I am using
autodoc_typehints = "description"
in conf.py to add type hints in the rendered docstring. Then the following docstringis rendered like this:
So far so good. But next I would like my rendered docstring to display whether a parameter is optional, i.e. has a default. In other words I want it to look like this:
Is there a way to achieve this automatically?