Skip to content

Commit d678336

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 5a05213 commit d678336

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/_array_api_conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
("py:class", ".*array"),
6969
("py:class", ".*device"),
7070
("py:class", ".*dtype"),
71+
("py:class", ".*Self"),
7172
("py:class", ".*NestedSequence"),
7273
("py:class", ".*SupportsBufferProtocol"),
7374
("py:class", ".*PyCapsule"),

src/array_api_stubs/_draft/array_object.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
from typing import TYPE_CHECKING, Protocol, TypeVar
66

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

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

0 commit comments

Comments
 (0)