Skip to content

🏷️ stub _-{l,r}]strip_chars #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions src/numpy-stubs/_core/umath.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,39 @@ class _Call21Float(Protocol):
**kwds: Unpack[_Kwargs3],
) -> Any: ...

@type_check_only
class _UFunc21String(Protocol):
@overload
def __call__( # (scalar, scalar) -> scalar
self,
x1: bytes | str,
x2: bytes | str,
/,
out: None = None,
*,
where: bool = True,
casting: _CastingKind = "same_kind",
order: _OrderKACF = "K",
dtype: _DTypeLikeBool | None = None,
subok: bool = True,
signature: str | tuple[DTypeLike, _DTypeLikeBool] | None = None,
) -> Any: ...
@overload
def __call__( # (array, array) -> array
self,
x1: _ToCharStringND,
x2: _ToCharStringND,
/,
out: None = None,
*,
where: bool = True,
casting: _CastingKind = "same_kind",
order: _OrderKACF = "K",
dtype: _DTypeLikeBool | None = None,
subok: bool = True,
signature: str | tuple[DTypeLike, _DTypeLikeBool] | None = None,
) -> NDArray[Any]: ...

@type_check_only
class _Call21Logical(Protocol):
@overload # (scalar, scalar, dtype: np.object_) -> np.object_
Expand Down Expand Up @@ -1805,9 +1838,9 @@ add: Final[_ufunc_2_1] = ...

_expandtabs: _ufunc_2_1
_expandtabs_length: _ufunc_2_1
_lstrip_chars: _ufunc_2_1
_rstrip_chars: _ufunc_2_1
_strip_chars: _ufunc_2_1
_lstrip_chars: _ufunc_2_1[_UFunc21String]
_rstrip_chars: _ufunc_2_1[_UFunc21String]
_strip_chars: _ufunc_2_1[_UFunc21String]
_zfill: _ufunc_2_1

###
Expand Down