Skip to content

Commit aa21251

Browse files
committed
🎨 simplify inexact arithmetic binops using the NEP 50 embeddings
1 parent 233898d commit aa21251

File tree

2 files changed

+191
-1025
lines changed

2 files changed

+191
-1025
lines changed

‎src/_numtype/_nep50.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ class _CanNEP50Rule4(Protocol[_OtherT_contra, _T_co]):
4444
class _CanNEP50Rule5(Protocol[_OtherT_contra, _T_co]):
4545
def __nep50_rule5__(self, other: _OtherT_contra, /) -> _T_co: ...
4646

47+
@type_check_only
48+
class _CanNEP50Rule6(Protocol[_OtherT_contra, _T_co]):
49+
def __nep50_rule6__(self, other: _OtherT_contra, /) -> _T_co: ...
50+
4751
_WithT = TypeVar("_WithT")
4852
_OutT = TypeVar("_OutT", bound=np.generic)
4953

@@ -55,7 +59,8 @@ PromoteWith = TypeAliasType(
5559
| _CanNEP50Rule2[_WithT, _OutT]
5660
| _CanNEP50Rule3[_WithT, _OutT]
5761
| _CanNEP50Rule4[_WithT, _OutT]
58-
| _CanNEP50Rule5[_WithT, _OutT],
62+
| _CanNEP50Rule5[_WithT, _OutT]
63+
| _CanNEP50Rule6[_WithT, _OutT],
5964
type_params=(_WithT, _OutT),
6065
)
6166
PromoteWith0D = TypeAliasType(

0 commit comments

Comments
 (0)