8000 TYP: Shape-typed array constructors: ``numpy.{empty,zeros,ones,full}`` by jorenham · Pull Request #27171 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TYP: Shape-typed array constructors: numpy.{empty,zeros,ones,full} #27171

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 2 commits into from
Sep 2, 2024
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
TYP,TST: Fix failing type-tests caused by a mypy 1.11 bug
  • Loading branch information
jorenham committed Sep 2, 2024
commit f3dd2e1a0174a08ff89a36b3a19c0a5e45734703
8 changes: 4 additions & 4 deletions numpy/typing/tests/data/pass/literal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
(KACF, AR.flatten),
(KACF, AR.ravel),
(KACF, partial(np.array, 1)),
(CF, partial(np.zeros, 1)),
(CF, partial(np.ones, 1)),
(CF, partial(np.empty, 1)),
# NOTE: __call__ is needed due to mypy 1.11 bugs (#17620, #17631)
(CF, partial(np.zeros.__call__, 1)),
(CF, partial(np.ones.__call__, 1)),
(CF, partial(np.empty.__call__, 1)),
(CF, partial(np.full, 1, 1)),
(KACF, partial(np.zeros_like, AR)),
(KACF, partial(np.ones_like, AR)),
(KACF, partial(np.empty_like, AR)),
(KACF, partial(np.full_like, AR, 1)),
# __call__ is needed due to mypy 1.11 bugs (#17620, #17631)
(KACF, partial(np.add.__call__, 1, 1)), # i.e. np.ufunc.__call__
(ACF, partial(np.reshape, AR, 1)),
(KACF, partial(np.ravel, AR)),
Expand Down
0