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
Update _Intrinsic for sphinx to capture the inner docstring #6915
Conversation
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.
Thanks for the patch!
I have manually tested against the doctest case in #6308.
self.assertEqual("void_func", void_func.__name__) | ||
self.assertEqual("TestIntrinsic.test_docstring.<locals>.void_func", | ||
void_func.__qualname__) | ||
self.assertDictEqual({'a': int}, void_func.__annotations__) |
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 wasn't aware these were added. I'll need to try in my next PR.
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.
functools.update_wrapper
updates the following fields: __module__
, __name__
, __qualname__
, __annotations__
and __doc__
(ref)
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.
oops, I mean assertDictEqual
, not anything particular in your PR. (I was rushing to finish up the review before starting a meeting and didn't realize the confusing comment.)
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.
Oh, ok 😄
As title.
This also fixes #6308