functools.wraps keeps the runtime signature but Sphinx shows star args
Python 3.10. I have a decorator using @wraps(func) and inspect.signature() shows the wrapped function's signature correctly. But Sphinx autodoc renders the decorator's signature (args, *kwargs) instead of the real one. I'm on Sphinx 7.2. Any idea what autodoc looks at? Is there a config option I'm missing, or does wraps not propagate everything autodoc needs? The docs claim it copies __name__, __doc__, and __module__, but I can't find any mention of signature metadata.
4 replies