Skip to content

Conversation

@BvB93
Copy link
Member

@BvB93 BvB93 commented Jul 11, 2022

Xref #21737

Allow all nin=1 ufuncs to accept objects implementing the __array_ufunc__ protocol.

The changes introduced herein should be extended to the nin=2 ufuncs as well, but this is substantially more difficult without regressing all np.ndarray output types to Any. Namely, we want to new overload to apply to all __array_ufunc__ implementations except np.ndarray, which is a bit of mess to do with the lack of some type of not-operator and the nin=2 input combinatorics.

@BvB93 BvB93 added this to the 1.23.2 release milestone Jul 11, 2022
@BvB93
Copy link
Member Author

BvB93 commented Jul 11, 2022

Marking this as a backport candidate, as it partially fixes a false positive that's troubling xarray (xref pydata/xarray#6524).

@charris charris merged commit a878789 into numpy:main Jul 12, 2022
@charris charris assigned charris and unassigned charris Jul 12, 2022
@charris
Copy link
Member

charris commented Jul 12, 2022

Thanks Bas.

@BvB93 BvB93 deleted the array_ufunc2 branch July 13, 2022 11:23
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 24, 2022
@charris charris removed this from the 1.23.2 release milestone Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants