Skip to content

Update _Intrinsic for sphinx to capture the inner docstring - #6915

Merged
sklam merged 4 commits into
numba:masterfrom
guilhermeleobas:sphinx-intrinsics
Apr 13, 2021
Merged

sklam merged 4 commits into
numba:masterfrom
guilhermeleobas:sphinx-intrinsics

Conversation

@guilhermeleobas

@guilhermeleobas guilhermeleobas commented Apr 12, 2021 •

Copy link
Copy Markdown
Contributor

As title.

This also fixes #6308

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

@sklam sklam left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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