10000 TYP: Type ``MaskedArray.filled`` and ``np.ma.filled`` by MarcoGorelli · Pull Request #28742 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TYP: Type MaskedArray.filled and np.ma.filled #28742

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 4 commits into from
Apr 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading< 8000 /span>
Diff view
Diff view
Prev Previous commit
overload _ArrayLike[_ScalarT_co] too
  • Loading branch information
MarcoGorelli committed Apr 17, 2025
commit 428d5085fb9166b8ba8fbc24f9a7f17217521cc6
3 changes: 3 additions & 0 deletions numpy/ma/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ _DTypeT = TypeVar("_DTypeT", bound=dtype[Any])
_DTypeT_co = TypeVar("_DTypeT_co", bound=dtype[Any], covariant=True)
_ArrayT = TypeVar("_ArrayT", bound=ndarray[Any, Any])
_ScalarT = TypeVar("_ScalarT", bound=generic)
_ScalarT_co = TypeVar("_ScalarT_co", bound=generic)
# A subset of `MaskedArray` that can be parametrized w.r.t. `np.generic`
_MaskedArray: TypeAlias = MaskedArray[_Shape, dtype[_ScalarT]]

Expand All @@ -242,6 +243,8 @@ def common_fill_value(a, b): ...
@overload
def filled(a: ndarray[_ShapeT_co, _DTypeT_co], fill_value: _ScalarLike_co | None = None) -> ndarray[_ShapeT_co, _DTypeT_co]: ...
@overload
def filled(a: _ArrayLike[_ScalarT_co], fill_value: _ScalarLike_co | None = None) -> NDArray[_ScalarT_co]: ...
@overload
def filled(a: ArrayLike, fill_value: _ScalarLike_co | None = None) -> NDArray[Any]: ...
def getdata(a, subok=...): ...
get_data = getdata
Expand Down
Loading
0