Skip to content

Commit

Permalink
Resolve some Sphinx doc build errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rgommers committed Feb 21, 2023
1 parent 6950944 commit a89e905
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/_array_api_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
17 changes: 8 additions & 9 deletions src/array_api_stubs/_draft/array_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down

0 comments on commit a89e905

Please sign in to comment.