-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autodoc: Use type stub files when documenting native modules #13253
Conversation
This is a ground shaking improvement for the whole ecosystem. I have to ask:
Edit: @hoefling points out problems with putting docstrings in stub files |
OH YES!!! This would be awesome to have available... FINALLY!!! Fingers crossed it gets merged. |
as a note. if there is a stub file then the docstrings should be in that file. The purpose for the stub file is not just for typing. It is also to remove code that doesn't need to be apart of the running code. The only place where I can see this being an issue is with python's built in that is the only thing I can see as being a problem other than dynamic creation of classes and in that case there would not be a stub file unless one is generated. |
Last I checked mypy stops type checking your Likely we'll get several more years of new typing PEPs without proper support for them. |
# Conflicts: # CHANGES.rst
Purpose
This builds on work originally proposed by @alliefitter in #4824. Autodoc now attempts to load a
.pyi
stub file for any native modules being documented.Currently this will become the default behaviour, but we could put it behind an environment variable if it might be disruptive (
SPHINX_AUTODOC_USE_NATIVE_STUB_FILES
?).cc commenters from original threads: @JosXa, @hoefling, @Vanuan, @cmpute, @brenthuisman, @kdschlosser, @jonnor.
References
A