Skip to content

Commit ae20262

Browse files
committed
Fix circular import
1 parent 6269d7b commit ae20262

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/array_api_typing/_namespace.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
"""Static typing support for the array API standard."""
22

3-
from typing import Protocol
3+
from __future__ import annotations
4+
5+
from typing import TYPE_CHECKING, Protocol
46
from typing_extensions import TypeVar
57

6-
from ._array import Array
7-
from ._device import Device
8-
from ._dtype import DType
9-
from .signature_types import NestedSequence, SupportsBufferProtocol
8+
if TYPE_CHECKING:
9+
from ._array import Array
10+
from ._device import Device
11+
from ._dtype import DType
12+
from .signature_types import NestedSequence, SupportsBufferProtocol
1013

11-
A = TypeVar("A", bound=Array, default=Array) # PEP 696 default
14+
A = TypeVar("A", bound=Array, default=Array) # PEP 696 default
15+
else:
16+
A = TypeVar("A")
1217

1318

1419
class ArrayNamespace(Protocol[A]):

0 commit comments

Comments
 (0)