Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 846 Bytes

README.md

File metadata and controls

21 lines (13 loc) · 846 Bytes

Documenting a C extension with stub files

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:

no args

Using the signatures from stubs, the result could be:

full sig