Skip to content

Commit c3b35df

Browse files
committed
✨ overloaded __call__ signatures
1 parent 54319e0 commit c3b35df

File tree

1 file changed

+43
-76
lines changed

1 file changed

+43
-76
lines changed

src/numpy-stubs/ma/core.pyi

+43-76
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,46 @@ class _frommethod:
865865
__doc__: str
866866
reversed: Incomplete
867867
def __init__(self, methodname: Incomplete, reversed: Incomplete = ...) -> None: ...
868-
def __call__(self, a: Incomplete, *args: Incomplete, **params: Incomplete) -> Incomplete: ...
868+
@overload
869+
def __call__(
870+
self,
871+
a: _ArrayT, # pyright: ignore[reportInvalidTypeVarUse]
872+
axis: None = None,
873+
fill_value: _ScalarLike_co | None = None,
874+
out: None = None,
875+
*,
876+
keepdims: L[False] | _NoValueType = ...,
877+
) -> intp: ...
878+
@overload
879+
def __call__(
880+
self,
881+
a: _ArrayT, # pyright: ignore[reportInvalidTypeVarUse]
882+
axis: CanIndex | None = None,
883+
fill_value: _ScalarLike_co | None = None,
884+
out: None = None,
885+
*,
886+
keepdims: bool | _NoValueType = ...,
887+
) -> Any: ...
888+
@overload
889+
def __call__(
890+
self,
891+
a: _ArrayT,
892+
axis: CanIndex | None = None,
893+
fill_value: _ScalarLike_co | None = None,
894+
*,
895+
out: _ArrayT,
896+
keepdims: bool | _NoValueType = ...,
897+
) -> _ArrayT: ...
898+
@overload
899+
def __call__(
900+
self,
901+
a: _ArrayT,
902+
axis: CanIndex | None,
903+
fill_value: _ScalarLike_co | None,
904+
out: _ArrayT,
905+
*,
906+
keepdims: bool | _NoValueType = ...,
907+
) -> _ArrayT: ...
869908
def getdoc(self) -> Incomplete: ...
870909

871910
class _convert2ma:
@@ -1134,78 +1173,6 @@ count: _frommethod
11341173
minimum: _extrema_operation
11351174
maximum: _extrema_operation
11361175

1137-
#
1138-
@overload
1139-
def argmin(
1140-
a: _ArrayT, # pyright: ignore[reportInvalidTypeVarUse]
1141-
axis: None = None,
1142-
fill_value: _ScalarLike_co | None = None,
1143-
out: None = None,
1144-
*,
1145-
keepdims: L[False] | _NoValueType = ...,
1146-
) -> intp: ...
1147-
@overload
1148-
def argmin(
1149-
a: _ArrayT, # pyright: ignore[reportInvalidTypeVarUse]
1150-
axis: CanIndex | None = None,
1151-
fill_value: _ScalarLike_co | None = None,
1152-
out: None = None,
1153-
*,
1154-
keepdims: bool | _NoValueType = ...,
1155-
) -> Any: ...
1156-
@overload
1157-
def argmin(
1158-
a: _ArrayT,
1159-
axis: CanIndex | None = None,
1160-
fill_value: _ScalarLike_co | None = None,
1161-
*,
1162-
out: _ArrayT,
1163-
keepdims: bool | _NoValueType = ...,
1164-
) -> _ArrayT: ...
1165-
@overload
1166-
def argmin(
1167-
a: _ArrayT,
1168-
axis: CanIndex | None,
1169-
fill_value: _ScalarLike_co | None,
1170-
out: _ArrayT,
1171-
*,
1172-
keepdims: bool | _NoValueType = ...,
1173-
) -> _ArrayT: ...
1174-
1175-
#
1176-
@overload
1177-
def argmax(
1178-
a: _ArrayT, # pyright: ignore[reportInvalidTypeVarUse]
1179-
axis: None = None,
1180-
fill_value: _ScalarLike_co | None = None,
1181-
out: None = None,
1182-
*,
1183-
keepdims: L[False] | _NoValueType = ...,
1184-
) -> intp: ...
1185-
@overload
1186-
def argmax(
1187-
a: _ArrayT, # pyright: ignore[reportInvalidTypeVarUse]
1188-
axis: CanIndex | None = None,
1189-
fill_value: _ScalarLike_co | None = None,
1190-
out: None = None,
1191-
*,
1192-
keepdims: bool | _NoValueType = ...,
1193-
) -> Any: ...
1194-
@overload
1195-
def argmax(
1196-
a: _ArrayT,
1197-
axis: CanIndex | None = None,
1198-
fill_value: _ScalarLike_co | None = None,
1199-
*,
1200-
out: _ArrayT,
1201-
keepdims: bool | _NoValueType = ...,
1202-
) -> _ArrayT: ...
1203-
@overload
1204-
def argmax(
1205-
a: _ArrayT,
1206-
axis: CanIndex | None,
1207-
fill_value: _ScalarLike_co | None,
1208-
out: _ArrayT,
1209-
*,
1210-
keepdims: bool | _NoValueType = ...,
1211-
) -> _ArrayT: ...
1176+
# Declare argmin and argmax as _frommethod instances
1177+
argmin: _frommethod
1178+
argmax: _frommethod

0 commit comments

Comments
 (0)