Skip to content

Commit 605dd64

Browse files
authored
Merge pull request #29630 from jorenham/numtype/693
TYP: fix slightly incorrect ``memoryview`` type argument in ``ScalarType``
2 parents 47430c7 + 6089ecb commit 605dd64

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

numpy/_core/numerictypes.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from builtins import bool as py_bool
2-
from typing import Final, Literal as L, TypedDict, type_check_only
2+
from typing import Any, Final, Literal as L, TypedDict, type_check_only
33

44
import numpy as np
55
from numpy import (
@@ -166,7 +166,7 @@ ScalarType: Final[
166166
type[py_bool],
167167
type[bytes],
168168
type[str],
169-
type[memoryview],
169+
type[memoryview[Any]],
170170
type[np.bool],
171171
type[csingle],
172172
type[cdouble],

numpy/typing/tests/data/reveal/numerictypes.pyi

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,6 @@ from typing import Literal, assert_type
22

33
import numpy as np
44

5-
assert_type(
6-
np.ScalarType,
7-
tuple[
8-
type[int],
9-
type[float],
10-
type[complex],
11-
type[bool],
12-
type[bytes],
13-
type[str],
14-
type[memoryview],
15-
type[np.bool],
16-
type[np.csingle],
17-
type[np.cdouble],
18-
type[np.clongdouble],
19-
type[np.half],
20-
type[np.single],
21-
type[np.double],
22-
type[np.longdouble],
23-
type[np.byte],
24-
type[np.short],
25-
type[np.intc],
26-
type[np.long],
27-
type[np.longlong],
28-
type[np.timedelta64],
29-
type[np.datetime64],
30-
type[np.object_],
31-
type[np.bytes_],
32-
type[np.str_],
33-
type[np.ubyte],
34-
type[np.ushort],
35-
type[np.uintc],
36-
type[np.ulong],
37-
type[np.ulonglong],
38-
type[np.void],
39-
],
40-
)
415
assert_type(np.ScalarType[0], type[int])
426
assert_type(np.ScalarType[3], type[bool])
437
assert_type(np.ScalarType[8], type[np.csingle])

0 commit comments

Comments
 (0)