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

TYP: Relax the type of ndarray.__array_finalize__ #20768

Merged
merged 1 commit into from Jan 8, 2022

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Jan 8, 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.

Note that this is a 1.22.1-exclusive PR, as the concernes addressed above are irrelevant once #20766 is merged.

@BvB93 BvB93 added this to the 1.22.1 release milestone Jan 8, 2022
@BvB93 BvB93 linked an issue Jan 8, 2022 that may be closed by this pull request
@charris charris merged commit 8f87be6 into numpy:maintenance/1.22.x Jan 8, 2022
@charris
Copy link
Member

charris commented Jan 8, 2022

Thanks Bas.

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