8000 TYP: Overhaul the typing test suite · Python-Repository-Hub/numpy@fb65dc5 · GitHub
[go: up one dir, main page]

Skip to content

Commit fb65dc5

Browse files
committed
TYP: Overhaul the typing test suite
1 parent d35196e commit fb65dc5

File tree

3 files changed

+55
-237
lines changed

3 files changed

+55
-237
lines changed

numpy/typing/mypy_plugin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def _get_precision_dict() -> dict[str, str]:
7575

7676

7777
def _get_extended_precision_list() -> list[str]:
78-
extended_types = [np.ulonglong, np.longlong, np.longdouble, np.clongdouble]
79-
extended_names = {
78+
extended_names = [
8079
"uint128",
8180
"uint256",
8281
"int128",
@@ -89,8 +88,8 @@ def _get_extended_precision_list() -> list[str]:
8988
"complex192",
9089
"complex256",
9190
"complex512",
92-
}
93-
return [i.__name__ for i in extended_types if i.__name__ in extended_names]
91+
]
92+
return [i for i in extended_names if hasattr(np, i)]
9493

9594

9695
def _get_c_intp_name() -> str:

numpy/typing/tests/data/mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
plugins = numpy.typing.mypy_plugin
33
show_absolute_path = True
44
implicit_reexport = False
5+
pretty = True

0 commit comments

Comments
 (0)
0