Skip to content

hoefling/sphinx-autodoc-c-ext-type-hints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This is a use case for sphinx/sphinx-doc#4824

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published