Skip to content

Commit b9ac9af

Browse files
authored
avoid using typing_extensions (#35)
Signed-off-by: nstarman <[email protected]> Signed-off-by: nstarman <[email protected]>
1 parent 350fe13 commit b9ac9af

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/overload_numpy/implementors/ufunc.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
from overload_numpy.utils import UFMT, UFMsT, _get_key, _parse_methods
2525

2626
if TYPE_CHECKING:
27-
# THIRDPARTY
28-
from typing_extensions import NotRequired
29-
3027
# LOCAL
3128
from overload_numpy._typeutils import UFuncLike
3229
from overload_numpy.overload import NumPyOverloader
@@ -41,15 +38,21 @@
4138
UT = TypeVar("UT", "ImplementsUFunc", "AssistsUFunc")
4239

4340

44-
class UFuncMethodOverloadMap(TypedDict):
45-
"""Dictionary of |ufunc| method key (str) to the method overload (func)."""
41+
# TODO! merge with UFuncMethodOverloadMap when NotRequired (py3.11+)
42+
class UFuncMethodRequiredOverloadMap(TypedDict):
43+
"""Dictionary of required |ufunc| methods."""
4644

4745
__call__: Callable[..., Any]
48-
at: NotRequired[Callable[..., Any]]
49-
accumulate: NotRequired[Callable[..., Any]]
50-
outer: NotRequired[Callable[..., Any]]
51-
reduce: NotRequired[Callable[..., Any]]
52-
reduceat: NotRequired[Callable[..., Any]]
46+
47+
48+
class UFuncMethodOverloadMap(UFuncMethodRequiredOverloadMap, total=False):
49+
"""Dictionary of |ufunc| method key (str) to the method overload (func)."""
50+
51+
at: Callable[..., Any]
52+
accumulate: Callable[..., Any]
53+
outer: Callable[..., Any]
54+
reduce: Callable[..., Any]
55+
reduceat: Callable[..., Any]
5356

5457

5558
##############################################################################

0 commit comments

Comments
 (0)