@@ -27,10 +27,13 @@ class _ModeFunc(Protocol):
2727
2828# TODO: In practice each keyword argument is exclusive to one or more
2929# specific modes. Consider adding more overloads to express this in the future.
30+
31+ _PadWidth : TypeAlias = _ArrayLikeInt | dict [int , int ] | dict [int , tuple [int , int ]] | dict [int , int | tuple [int , int ]]
32+
3033@overload
3134def pad (
3235 array : _ArrayLike [_ScalarT ],
33- pad_width : _ArrayLikeInt ,
36+ pad_width : _PadWidth ,
3437 mode : _ModeKind = ...,
3538 * ,
3639 stat_length : _ArrayLikeInt | None = ...,
@@ -41,7 +44,7 @@ def pad(
4144@overload
4245def pad (
4346 array : ArrayLike ,
44- pad_width : _ArrayLikeInt ,
47+ pad_width : _PadWidth ,
4548 mode : _ModeKind = ...,
4649 * ,
4750 stat_length : _ArrayLikeInt | None = ...,
@@ -51,7 +54,7 @@ def pad(
5154) -> _nt .Array [Incomplete ]: ...
5255@overload
5356def pad (
54- array : _ArrayLike [_ScalarT ], pad_width : _ArrayLikeInt , mode : _ModeFunc , ** kwargs : object
57+ array : _ArrayLike [_ScalarT ], pad_width : _PadWidth , mode : _ModeFunc , ** kwargs : object
5558) -> _nt .Array [_ScalarT ]: ...
5659@overload
57- def pad (array : ArrayLike , pad_width : _ArrayLikeInt , mode : _ModeFunc , ** kwargs : object ) -> _nt .Array [Incomplete ]: ...
60+ def pad (array : ArrayLike , pad_width : _PadWidth , mode : _ModeFunc , ** kwargs : object ) -> _nt .Array [Incomplete ]: ...
0 commit comments