From 3120c5456006aab3c6156c9a87f02b5e8ac86b11 Mon Sep 17 00:00:00 2001 From: Lucas Colley Date: Sat, 23 Nov 2024 16:41:28 +0000 Subject: [PATCH] small fix for coverage --- src/array_api_extra/_compat.py | 4 ++-- src/array_api_extra/_utils.py | 4 ++-- tests/test_funcs.py | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/array_api_extra/_compat.py b/src/array_api_extra/_compat.py index 6d875b6..e836ba7 100644 --- a/src/array_api_extra/_compat.py +++ b/src/array_api_extra/_compat.py @@ -4,9 +4,9 @@ import inspect import sys -from typing import TYPE_CHECKING +import typing -if TYPE_CHECKING: +if typing.TYPE_CHECKING: from ._typing import Array, Device __all__ = ["device"] diff --git a/src/array_api_extra/_utils.py b/src/array_api_extra/_utils.py index 93eeee6..26fbb56 100644 --- a/src/array_api_extra/_utils.py +++ b/src/array_api_extra/_utils.py @@ -1,8 +1,8 @@ from __future__ import annotations # https://github.com/pylint-dev/pylint/pull/9990 -from typing import TYPE_CHECKING +import typing -if TYPE_CHECKING: +if typing.TYPE_CHECKING: from ._typing import Array, ModuleType from . import _compat diff --git a/tests/test_funcs.py b/tests/test_funcs.py index a8db987..02a0ecf 100644 --- a/tests/test_funcs.py +++ b/tests/test_funcs.py @@ -1,8 +1,9 @@ from __future__ import annotations import contextlib +import typing import warnings -from typing import TYPE_CHECKING, Any +from typing import Any # array-api-strict#6 import array_api_strict as xp # type: ignore[import-untyped] @@ -12,7 +13,7 @@ from array_api_extra import atleast_nd, cov, create_diagonal, expand_dims, kron, sinc -if TYPE_CHECKING: +if typing.TYPE_CHECKING: Array = Any # To be changed to a Protocol later (see array-api#589)