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
Close #2755: autodoc: Support type_comment style annotation #6984
Conversation
f27444d
to
dac0e13
Compare
37517a9
to
a5f3ca1
Compare
7095d52
to
9158d5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's time to merge. I'll merge this after minor fixes.
Note: python3.8+ or typed_ast is required
9158d5e
to
ffdfb6c
Compare
Merged. Thank you for reviewing! @shimizukawa @eric-wieser |
What's the purpose of It seems like this code would become simpler if you just built the type comment knowledge into |
Edit: Ah, I see it's to make it opt in. Maybe the extension should be called |
It was added to update the signature of function before processing. The use case of the event are 1) type_comments and 2) .pyi files (refs: #4824). I don't know there are any more use case for the event. But I thought it is simple to separate them from In addition, the |
What I've found is that you seem to end up having to implement the internals of See #7384 for an example of this. Good point about the |
Indeed. The autodoc + type_comment + Sphinx's inspect module would be an enhanced version of Anyway, the event has been released as stable. So we need to keep it working for a while if we'll mark it deprecated. About the |
Feature or Bugfix
Purpose