Skip to content

Commit

Permalink
Merge pull request data-apis#76 from lucascolley/annotations
Browse files Browse the repository at this point in the history
TYP: import annotations for sklearn
  • Loading branch information
lucascolley authored Jan 3, 2025
2 parents 84bf725 + b6d43d1 commit 346365d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/array_api_extra/_funcs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Public API Functions."""

# https://github.com/scikit-learn/scikit-learn/pull/27910#issuecomment-2568023972
from __future__ import annotations

import operator
import warnings

Expand Down Expand Up @@ -719,7 +722,7 @@ def __init__(
self._x = x
self._idx = idx

def __getitem__(self, idx: Index, /) -> "at": # numpydoc ignore=PR01,RT01
def __getitem__(self, idx: Index, /) -> at: # numpydoc ignore=PR01,RT01
"""
Allow for the alternate syntax ``at(x)[start:stop:step]``.
Expand Down
3 changes: 3 additions & 0 deletions src/array_api_extra/_lib/_compat.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Static type stubs for `_compat.py`."""

# https://github.com/scikit-learn/scikit-learn/pull/27910#issuecomment-2568023972
from __future__ import annotations

from types import ModuleType

from ._typing import Array, Device
Expand Down
3 changes: 3 additions & 0 deletions src/array_api_extra/_lib/_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Utility functions used by `array_api_extra/_funcs.py`."""

# https://github.com/scikit-learn/scikit-learn/pull/27910#issuecomment-2568023972
from __future__ import annotations

from . import _compat
from ._typing import Array, ModuleType

Expand Down

0 comments on commit 346365d

Please sign in to comment.