Skip to content

Commit 389e042

Browse files
rgommersnstarman
authored andcommitted
Resolve some Sphinx doc build errors
Sphinx doesn't set `TYPE_CHECKING`, but does use the type annotations. `Self` is unknown to Sphinx, so should be filtered out to prevent lots of errors.
1 parent 83d5bd0 commit 389e042

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/_array_api_conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
('py:class', '.*array'),
6363
('py:class', '.*device'),
6464
('py:class', '.*dtype'),
65+
('py:class', '.*Self'),
6566
('py:class', '.*NestedSequence'),
6667
('py:class', '.*SupportsBufferProtocol'),
6768
('py:class', '.*PyCapsule'),

src/array_api_stubs/_draft/array_object.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22

33
from typing import TYPE_CHECKING, Protocol, TypeVar
44

5-
if TYPE_CHECKING:
6-
from ._types import (
7-
dtype as Dtype,
8-
device as Device,
9-
Any,
10-
PyCapsule,
11-
Enum,
12-
ellipsis,
13-
)
5+
from ._types import (
6+
dtype as Dtype,
7+
device as Device,
8+
Any,
9+
PyCapsule,
10+
Enum,
11+
ellipsis,
12+
)
1413

1514
Self = TypeVar("Self", bound="Array")
1615
# NOTE: when working with py3.11+ this can be ``typing.Self``.

0 commit comments

Comments
 (0)