8000 ENH: Refactor the typing "reveal" tests using `typing.assert_type` by BvB93 · Pull Request #24637 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Refactor the typing "reveal" tests using typing.assert_type #24637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TYP: Overhaul the typing test suite
  • Loading branch information
BvB93 committed Sep 4, 2023
commit c650ab3dc8639868a33bd342f2db64ff0430308e
7 changes: 3 additions & 4 deletions numpy/typing/mypy_plugin.py
B88E
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def _get_precision_dict() -> dict[str, str]:


def _get_extended_precision_list() -> list[str]:
extended_types = [np.ulonglong, np.longlong, np.longdouble, np.clongdouble]
extended_names = {
extended_names = [
"uint128",
"uint256",
"int128",
Expand All @@ -89,8 +88,8 @@ def _get_extended_precision_list() -> list[str]:
"complex192",
"complex256",
"complex512",
}
return [i.__name__ for i in extended_types if i.__name__ in extended_names]
]
return [i for i in extended_names if hasattr(np, i)]


def _get_c_intp_name() -> str:
Expand Down
1 change: 1 addition & 0 deletions numpy/typing/tests/data/mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
plugins = numpy.typing.mypy_plugin
show_absolute_path = True
implicit_reexport = False
pretty = True
Loading
0