|
24 | 24 | from overload_numpy.utils import UFMT, UFMsT, _get_key, _parse_methods |
25 | 25 |
|
26 | 26 | if TYPE_CHECKING: |
27 | | - # THIRDPARTY |
28 | | - from typing_extensions import NotRequired |
29 | | - |
30 | 27 | # LOCAL |
31 | 28 | from overload_numpy._typeutils import UFuncLike |
32 | 29 | from overload_numpy.overload import NumPyOverloader |
|
41 | 38 | UT = TypeVar("UT", "ImplementsUFunc", "AssistsUFunc") |
42 | 39 |
|
43 | 40 |
|
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.""" |
46 | 44 |
|
47 | 45 | __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] |
53 | 56 |
|
54 | 57 |
|
55 | 58 | ############################################################################## |
|
0 commit comments