Skip to content

Commit 771d85a

Browse files
committed
type annotations
1 parent 8e4e8bb commit 771d85a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

array_api_strict/_elementwise_functions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from collections.abc import Callable
12
from functools import wraps
23
from types import NoneType
34

@@ -153,7 +154,11 @@ def bitwise_right_shift(x1: int | Array, x2: int | Array, /) -> Array:
153154
del func, _create_binary_func
154155

155156

156-
def _create_unary_func(func_name, dtype_category, np_func_name=None):
157+
def _create_unary_func(
158+
func_name: str,
159+
dtype_category: str,
160+
np_func_name: str | None = None,
161+
) -> Callable[[Array], Array]:
157162
allowed_dtypes = _dtype_categories[dtype_category]
158163
np_func_name = np_func_name or func_name
159164
np_func = getattr(np, np_func_name)
@@ -173,7 +178,7 @@ def func(x: Array, /) -> Array:
173178
return func
174179

175180

176-
def _identity_if_integer(func):
181+
def _identity_if_integer(func: Callable[[Array], Array]) -> Callable[[Array], Array]:
177182
"""Hack around NumPy 1.x behaviour for ceil, floor, and trunc
178183
vs. integer inputs
179184
"""

0 commit comments

Comments
 (0)