Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TYP: Relax the type of ndarray.__array_finalize__ #20764

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

Closed
wants to merge 1 commit into from

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Jan 7, 2022

Closes #20756
Xref #20717

Changes the default type of the ndarray.__array_finalize__ attribute from None to Any, this allowing subclasses to overwrite it with a method (without mypy complaining, that is). This is not the most ideal solution, but #20717 (comment) currently doesn't work due to what appears to be a mypy bug.

@mhvk
Copy link
Contributor

mhvk commented Jan 7, 2022

If we go with #20766, this would need adjustment.

@BvB93
Copy link
Member Author

BvB93 commented Jan 7, 2022

If we go with #20766, this would need adjustment.

That's fine, I'd say this PR is more of a triage anyway (especially for the 1.22.1 backport).

@BvB93 BvB93 removed this from the 1.22.1 release milestone Jan 7, 2022
@BvB93 BvB93 removed the 09 - Backport-Candidate PRs tagged should be backported label Jan 7, 2022
@BvB93
Copy link
Member Author

BvB93 commented Jan 7, 2022

Closing, will recreate this PR as a backport-only in light of #20766.

@BvB93 BvB93 closed this Jan 7, 2022
@BvB93 BvB93 deleted the finalize branch January 7, 2022 21:49
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.

TYP: incorrect array_finalize definition in ndarray for subclassing
2 participants