diff --git a/src/_array_api_conf.py b/src/_array_api_conf.py index ca8d2aaed..43bd763ef 100644 --- a/src/_array_api_conf.py +++ b/src/_array_api_conf.py @@ -61,6 +61,7 @@ ('py:class', '.*array'), ('py:class', '.*device'), ('py:class', '.*dtype'), + ('py:class', '.*Self'), ('py:class', '.*NestedSequence'), ('py:class', '.*SupportsBufferProtocol'), ('py:class', '.*PyCapsule'), diff --git a/src/array_api_stubs/_draft/array_object.py b/src/array_api_stubs/_draft/array_object.py index ddb96c527..b8c05a813 100644 --- a/src/array_api_stubs/_draft/array_object.py +++ b/src/array_api_stubs/_draft/array_object.py @@ -2,15 +2,14 @@ from typing import TYPE_CHECKING, Protocol, TypeVar -if TYPE_CHECKING: - from ._types import ( - dtype as Dtype, - device as Device, - Any, - PyCapsule, - Enum, - ellipsis, - ) +from ._types import ( + dtype as Dtype, + device as Device, + Any, + PyCapsule, + Enum, + ellipsis, +) Self = TypeVar("Self", bound="Array") # NOTE: when working with py3.11+ this can be ``typing.Self``.