Skip to content

TYP: Type MaskedArray.__array_finalize__ and MaskedArray.__array_wrap__ #29483

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

Merged
merged 3 commits into from
Aug 3, 2025

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Jul 30, 2025

The last untyped method in MaskedArray 😆 🥳

@MarcoGorelli MarcoGorelli marked this pull request as ready for review July 30, 2025 18:04
@jorenham jorenham self-requested a review July 30, 2025 20:31
@jorenham jorenham added the component: numpy.ma masked arrays label Jul 30, 2025
Comment on lines 524 to 530
def __array_wrap__(
self,
obj: ndarray[_ShapeT, _DTypeT],
context: tuple[ufunc, tuple[Any, ...], int] | None = None,
return_scalar: bool = False,
/,
) -> MaskedArray[_ShapeT, _DTypeT]: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one isn't positional-only

def __array_wrap__(self, obj, context=None, return_scalar=False):

@jorenham
Copy link
Member

Needs a rebase

@jorenham jorenham merged commit f5a6af8 into numpy:main Aug 3, 2025
78 checks passed
@jorenham
Copy link
Member

jorenham commented Aug 3, 2025

Thanks Marco 🎉!

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