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 #6982
Conversation
010342a
to
a49b484
Compare
a49b484
to
314be09
Compare
@@ -983,8 +983,10 @@ def format_args(self, **kwargs: Any) -> str: | |||
not inspect.isbuiltin(self.object) and | |||
not inspect.isclass(self.object) and | |||
hasattr(self.object, '__call__')): | |||
self.env.app.emit('autodoc-before-format-args', self.object.__call__, False) |
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.
I don't think this is good way to do this. But we have to let handlers know the target object is bound method or not...
2af277d
to
4fb1362
Compare
Note: python3.8+ or typed_ast is required
4fb1362
to
59dacd8
Compare
@eric-wieser Thank you for quick and wise comment! Updated. |
OMG. |
oh, I closed this PR wrongly. I'll post another one again |
Error message seems truncated:
Is there a way to get more info? |
Why not just reopen the PR? |
elif isinstance(typ, (ast.Constant, ast.NameConstant)): # type: ignore | ||
return repr(typ.value) | ||
else: | ||
raise NotImplementedError |
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.
raise NotImplementedError | |
raise NotImplementedError('Unable to render {} instances'.format(type(type).__name__)) |
Reposted as #6984 |
Feature or Bugfix
Purpose