diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2021-05-24 14:48:44 +0200 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-05-27 17:24:05 +0200 |
commit | e2450d9e3d2711a78e0ff22a184edf0b2bca58d5 (patch) | |
tree | de00a4f94a154e182814e1bd9600d9d854d9395d | |
parent | 66fa0481c0dd85d4f90dc56afe3f1b42b96945ad (diff) | |
download | numpy-e2450d9e3d2711a78e0ff22a184edf0b2bca58d5.tar.gz |
MAINT: Unconditionally import from `typing_extensions` while static type checking
`typing_extensions` is a de facto hard dependency of all static type checkers (via its use in typeshed), so we can safely import all >3.7-exclusive types from there without version checking
-rw-r--r-- | numpy/typing/__init__.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/numpy/typing/__init__.py b/numpy/typing/__init__.py index 80b4b18d4..ba41cc68a 100644 --- a/numpy/typing/__init__.py +++ b/numpy/typing/__init__.py @@ -176,11 +176,7 @@ else: _HAS_TYPING_EXTENSIONS = True if TYPE_CHECKING: - import sys - if sys.version_info >= (3, 8): - from typing import final - else: - from typing_extensions import final + from typing_extensions import final else: def final(f): return f |