@@ -189,6 +189,12 @@ _TimeLike: TypeAlias = np.datetime64 | np.timedelta64
189189_SupportsStringLikeArray : TypeAlias = _SupportsArray [np .dtypes .StringDType | np .dtype [np .character ]]
190190_ToCharStringND : TypeAlias = _nt .SequenceND [_SupportsStringLikeArray | list [str ] | list [bytes ] | list [str | bytes ]]
191191
192+ _Eq1 : TypeAlias = L [1 , True ]
193+ _Eq2 : TypeAlias = L [2 ]
194+ _Ge3 = TypeAliasType ("_Ge3" , L [3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ])
195+ _Ge1 : TypeAlias = _Eq1 | _Ge2
196+ _Ge2 : TypeAlias = _Eq2 | _Ge3
197+
192198###
193199# helper protocols
194200
@@ -2109,12 +2115,6 @@ class _Call1N2N_py(Protocol[_OutT_co]):
21092115 ** kwargs : Unpack [_Kwargs3_ ],
21102116 ) -> Incomplete : ...
21112117
2112- _3P = TypeAliasType ("_3P" , L [3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ])
2113- _2 : TypeAlias = L [2 ]
2114- _2P : TypeAlias = _2 | _3P
2115- _1 : TypeAlias = L [True , 1 ]
2116- _1P : TypeAlias = _1 | _2P
2117-
21182118_pyfunc_1_1 = TypeAliasType (
21192119 "_pyfunc_1_1" ,
21202120 np .ufunc [_Call11_py [_OutT ], _At1 , _ReduceE , _ReduceAtE , _AccumulateE , _OuterE ],
@@ -2143,20 +2143,22 @@ _pyfunc_1n_2n = TypeAliasType(
21432143
21442144# NOTE: We can't use e.g. `Concatenate[Any, ...]`, as that causes mypy to reject every function...
21452145@overload # (a) -> T
2146- def frompyfunc (f : Callable [[Incomplete ], _T ], / , nin : _1 , nout : _1 , * , identity : object = None ) -> _pyfunc_1_1 [_T ]: ...
2146+ def frompyfunc (
2147+ f : Callable [[Incomplete ], _T ], / , nin : _Eq1 , nout : _Eq1 , * , identity : object = None
2148+ ) -> _pyfunc_1_1 [_T ]: ...
21472149@overload # (a, b) -> T
21482150def frompyfunc (
2149- f : Callable [[Incomplete , Incomplete ], _T ], / , nin : _2 , nout : _1 , * , identity : object = None
2151+ f : Callable [[Incomplete , Incomplete ], _T ], / , nin : _Eq2 , nout : _Eq1 , * , identity : object = None
21502152) -> _pyfunc_2_1 [_T ]: ...
21512153@overload # (a, b, c, ...) -> T
2152- def frompyfunc (f : Callable [..., _T ], / , nin : _3P , nout : _1 , * , identity : object = None ) -> _pyfunc_3n_1 [_T ]: ...
2154+ def frompyfunc (f : Callable [..., _T ], / , nin : _Ge3 , nout : _Eq1 , * , identity : object = None ) -> _pyfunc_3n_1 [_T ]: ...
21532155@overload # (a, ...) -> (T1, T2)
21542156def frompyfunc ( # type: ignore[overload-overlap] # mypy-only false positive
2155- f : Callable [..., tuple [_T1 , _T2 ]], / , nin : _1P , nout : _2 , * , identity : object = None
2157+ f : Callable [..., tuple [_T1 , _T2 ]], / , nin : _Ge1 , nout : _Eq2 , * , identity : object = None
21562158) -> _pyfunc_1n_2 [_T1 , _T2 ]: ...
21572159@overload # (a, ...) -> (T1, T2, *(T, ...))
21582160def frompyfunc (
2159- f : Callable [..., tuple [_T1 , _T2 , * tuple [_T , ...]]], / , nin : _1P , nout : _2P , * , identity : object = None
2161+ f : Callable [..., tuple [_T1 , _T2 , * tuple [_T , ...]]], / , nin : _Ge1 , nout : _Ge2 , * , identity : object = None
21602162) -> _pyfunc_1n_2n [_T1 | _T2 | _T ]: ...
21612163@overload
21622164def frompyfunc (
0 commit comments