@@ -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
@@ -71,6 +71,8 @@ assert_type(np.dtype(Decimal), np.dtype[np.object_])
71
71
assert_type (np .dtype (Fraction ), np .dtype [np .object_ ])
72
72
73
73
# char-codes
74
+ assert_type (np .dtype ("?" ), np .dtype [np .bool ])
75
+ assert_type (np .dtype ("|b1" ), np .dtype [np .bool ])
74
76
assert_type (np .dtype ("u1" ), np .dtype [np .uint8 ])
75
77
assert_type (np .dtype ("l" ), np .dtype [np .long ])
76
78
assert_type (np .dtype ("longlong" ), np .dtype [np .longlong ])
@@ -113,7 +115,7 @@ assert_type(dtype_U.base, np.dtype[Any])
113
115
assert_type (dtype_U .subdtype , None | tuple [np .dtype [Any ], tuple [int , ...]])
114
116
assert_type (dtype_U .newbyteorder (), np .dtype [np .str_ ])
115
117
assert_type (dtype_U .type , type [np .str_ ])
116
- assert_type (dtype_U .name , str )
118
+ assert_type (dtype_U .name , LiteralString )
117
119
assert_type (dtype_U .names , None | tuple [str , ...])
118
120
119
121
assert_type (dtype_U * 0 , np .dtype [np .str_ ])
0 commit comments