If I decorate a test function using the sphinx decorator:
from deprecated.sphinx import deprecated
@deprecated(reason="Because", version="1.0.0")
class Test2:
"""A docstring for a class."""
def __init__(self, a: int = 1) -> None:
self.a = a
"""An attribute"""
def method(self) -> None:
"""A method."""
pass
class Test3:
"""A docstring for a class."""
def __init__(self, a: int = 1) -> None:
self.a = a
"""An attribute"""
def method(self) -> None:
"""A method."""
pass
And then use autodoc to build the documentation, then it all looks good (methods, attributes etc show nicely), except that the class signature is generalised, compared to the actual signature of the undecorated test class
classTest2(*args, **kwargs)
A docstring for a class.
Deprecated since version 1.0.0: Because
Versus
classTest3(a: int = 1)
A docstring for a class.
Is there a way to preserve those signature details?
If I decorate a test function using the sphinx decorator:
And then use
autodocto build the documentation, then it all looks good (methods, attributes etc show nicely), except that the class signature is generalised, compared to the actual signature of the undecorated test classVersus
Is there a way to preserve those signature details?