This is a working example for the use case described in this comment.
Naturally, it's not possible to extract the exact signature of Buzz.fuzz
with inspect.getfullargspec
, inspect.signature
etc,
but Sphinx could make use of the PEP 484 stubs when provided. In this example, while a stub fizz/__init__.pyi
is provided:
class Buzz:
def fuzz(self, x: str) -> None: ...
Sphinx renders a method with no arguments:
Using the signatures from stubs, the result could be: