Skip to content

Commit

Permalink
TYP: allow None in operand sequence of nditer
Browse files Browse the repository at this point in the history
Prevent type-hint errors when using `nditer` in an intended way (see https://numpy.org/doc/stable/reference/arrays.nditer.html#iterator-allocated-output-arrays).

Fix #28038
  • Loading branch information
simonaltrogge authored and charris committed Dec 20, 2024
1 parent 31bc4c8 commit 554739e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4746,7 +4746,7 @@ class iinfo(Generic[_IntegerT_co]):
class nditer:
def __new__(
cls,
op: ArrayLike | Sequence[ArrayLike],
op: ArrayLike | Sequence[ArrayLike | None],
flags: None | Sequence[_NDIterFlagsKind] = ...,
op_flags: None | Sequence[Sequence[_NDIterFlagsOp]] = ...,
op_dtypes: DTypeLike | Sequence[DTypeLike] = ...,
Expand Down

0 comments on commit 554739e

Please sign in to comment.