@@ -7,7 +7,7 @@ from typing import Any, Literal, TypeAlias
7
7
import numpy as np
8
8
from numpy .dtypes import StringDType
9
9
10
- from typing_extensions import assert_type
10
+ from typing_extensions import LiteralString , assert_type
11
11
12
12
# a combination of likely `object` dtype-like candidates (no `_co`)
13
13
_PyObjectLike : TypeAlias = Decimal | Fraction | dt .datetime | dt .timedelta
@@ -70,6 +70,8 @@ assert_type(np.dtype(Decimal), np.dtype[np.object_])
70
70
assert_type (np .dtype (Fraction ), np .dtype [np .object_ ])
71
71
72
72
# char-codes
73
+ assert_type (np .dtype ("?" ), np .dtype [np .bool ])
74
+ assert_type (np .dtype ("|b1" ), np .dtype [np .bool ])
73
75
assert_type (np .dtype ("u1" ), np .dtype [np .uint8 ])
74
76
assert_type (np .dtype ("l" ), np .dtype [np .long ])
75
77
assert_type (np .dtype ("longlong" ), np .dtype [np .longlong ])
@@ -111,7 +113,7 @@ assert_type(dtype_U.base, np.dtype[Any])
111
113
assert_type (dtype_U .subdtype , None | tuple [np .dtype [Any ], tuple [int , ...]])
112
114
assert_type (dtype_U .newbyteorder (), np .dtype [np .str_ ])
113
115
assert_type (dtype_U .type , type [np .str_ ])
114
- assert_type (dtype_U .name , str )
116
+ assert_type (dtype_U .name , LiteralString )
115
117
assert_type (dtype_U .names , None | tuple [str , ...])
116
118
117
119
assert_type (dtype_U * 0 , np .dtype [np .str_ ])
0 commit comments