Problem statement
Fix duplicated *args and **kwargs with autodoc_typehints
Bugfix
- Bugfix
Detail
Consider this
class _ClassWithDocumentedInitAndStarArgs:
"""Class docstring."""
def __init__(self, x: int, *args: int, **kwargs: int) -> None:
"""Init docstring.
:param x: Some integer
:param *args: Some integer
:param **kwargs: Some integer
"""when using the autodoc extension and the setting autodoc_typehints = "description".
WIth sphinx 4.2.0, the current output is
Class docstring.
Parameters:
* **x** (*int*) --
* **args** (*int*) --
* **kwargs** (*int*) --
Return type:
None
__init__(x, *args, **kwargs)
Init docstring.
Parameters:
* **x** (*int*) -- Some integer
* ***args** --
Some integer
* ****kwargs** --
Some integer
* **args** (*int*) --
* **kwargs** (*int*) --
Return type:
Nonewhere the *args and **kwargs are duplicated and incomplete.
The expected output is
Class docstring.
Parameters:
* **x** (*int*) --
* ***args** (*int*) --
* ****kwargs** (*int*) --
Return type:
None
__init__(x, *args, **kwargs)
Init docstring.
Parameters:
* **x** (*int*) -- Some integer
* ***args** (*int*) --
Some integer
* ****kwargs** (*int*) --
Some integer
Return type:
NoneThe environment starts at commit
195e911f1dab (sphinx-doc/sphinx 5.1), dependencies installed and tests runnable from the first minute. You are graded by hidden tests taken from the fix that was actually merged upstream.