I use stub files (i.e. "*.pyi" files) to manage type annotations in my project. My docstrings are in the actual source files. I've installed sphinx-autodoc-annotation
to get Sphinx to look at type annotations, but it doesn't look at the stub files. When generating the documentation via Sphinx, how does one pull the typing from the stub files?
class Foo:
def bar(self, baz: str) -> str:
...
class Foo:
def bar(self, baz):
"""Does some cool stuff
:param baz: some parameter that we do stuff with
"""
return baz
I was using stub files because I wanted to avoid cluttering my Python source files with type information. However, the simplest solution (for now) seems to be to put the type information into the source files anyway and do away with the stub files.