8000 TYP: run mypy in strict mode by jorenham · Pull Request #29097 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TYP: run mypy in strict mode #29097

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
May 31, 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
Diff view
Diff view
Prev Previous commit
Next Next commit
TYP: disable mypy's no-untyped-call errors in the MaskedArray typ…
…e-tests
  • Loading branch information
jorenham committed May 30, 2025
commit 51f4ac8f6188a4cd7dbb81ee4fff0cf7aef34e3e
2 changes: 2 additions & 0 deletions numpy/typing/tests/data/pass/ma.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
_ScalarT = TypeVar("_ScalarT", bound=np.generic)
MaskedArray: TypeAlias = np.ma.MaskedArray[_Shape, np.dtype[_ScalarT]]

# mypy: disable-error-code=no-untyped-call
Copy link
Member Author

Choose a reason for hiding this comment

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

this is required because numpy.ma.core.MaskedArray.__new__ is untyped.


MAR_b: MaskedArray[np.bool] = np.ma.MaskedArray([True])
MAR_u: MaskedArray[np.uint32] = np.ma.MaskedArray([1], dtype=np.uint32)
MAR_i: MaskedArray[np.int64] = np.ma.MaskedArray([1])
Expand Down
0