Skip to content
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

Merged
merged 4 commits into from Apr 13, 2021

Conversation

guilhermeleobas
Copy link
Collaborator

@guilhermeleobas guilhermeleobas commented Apr 12, 2021

As title.

This also fixes #6308

@guilhermeleobas guilhermeleobas marked this pull request as ready for review April 12, 2021 16:06
Copy link
Member

@sklam sklam left a 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__)
Copy link
Member

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.

Copy link
Collaborator Author

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)

Copy link
Member

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.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, ok 😄

@sklam sklam added 5 - Ready to merge Review and testing done, is ready to merge and removed 3 - Ready for Review labels Apr 13, 2021
@sklam sklam merged commit 096faa0 into numba:master Apr 13, 2021
@guilhermeleobas guilhermeleobas deleted the sphinx-intrinsics branch April 14, 2021 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge Effort - short Short size effort needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest doctest can't discover functions with @guvectorize decorator
3 participants