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

MAINT: Mark type-check-only ufunc subclasses as ufunc aliases during runtime #19958

Merged
merged 1 commit into from Sep 26, 2021

Conversation

@charris
Copy link
Member

@charris charris commented Sep 26, 2021

Backport of #19856.

Closes #19834

numpy.typing currently has a number of (type-check-only) ufunc subclasses that are used for differentiation the various combinations of ufunc.nin and ufunc.nout ufuncs. These classes were previously marked as Any during runtime however, which could trip up autocompletion tools such as Jedi.

This issue has been resolved by instead treating them as ufunc aliases during runtime, similar to how typing.TypedDict is treated w.r.t. dict.

@charris
Copy link
Member Author

@charris charris commented Sep 26, 2021

@BvB93 Ping for check. NumPy 1.21.x still supports Python 3.7.

Loading

@charris charris added this to the 1.21.3 release milestone Sep 26, 2021
BvB93
BvB93 approved these changes Sep 26, 2021
Copy link
Contributor

@BvB93 BvB93 left a comment

LGTM, the changes introduced herein work just as well with 3.7 as with >= 3.8.

Loading

@charris charris merged commit 51b7c50 into numpy:maintenance/1.21.x Sep 26, 2021
37 checks passed
Loading
@charris charris deleted the backport-19856 branch Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants