Skip to content

Commit 3864a97

Browse files
MAINT: Optional[T] → T | None
1 parent c274116 commit 3864a97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numpy/ctypeslib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ def ndpointer(dtype=None, ndim=None, shape=None, flags=None):
282282
283283
"""
284284

285-
# normalize dtype to an Optional[dtype]
285+
# normalize dtype to dtype | None
286286
if dtype is not None:
287287
dtype = _dtype(dtype)
288288

289-
# normalize flags to an Optional[int]
289+
# normalize flags to int | None
290290
num = None
291291
if flags is not None:
292292
if isinstance(flags, str):
@@ -304,7 +304,7 @@ def ndpointer(dtype=None, ndim=None, shape=None, flags=None):
304304
raise TypeError("invalid flags specification") from e
305305
num = _num_fromflags(flags)
306306

307-
# normalize shape to an Optional[tuple]
307+
# normalize shape to tuple | None
308308
if shape is not None:
309309
try:
310310
shape = tuple(shape)

0 commit comments

Comments
 (0)