diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 56c5a4d28af9..3122cc35d18a 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -75,6 +75,7 @@ _TBE = TypeVar("_TBE", bound="BaseException") _R = TypeVar("_R") # Return-type TypeVar _SupportsNextT = TypeVar("_SupportsNextT", bound=SupportsNext[Any], covariant=True) _SupportsAnextT = TypeVar("_SupportsAnextT", bound=SupportsAnext[Any], covariant=True) +_B = TypeVar("_B", bool, int) class _SupportsIter(Protocol[_T_co]): def __iter__(self) -> _T_co: ... @@ -702,30 +703,12 @@ class memoryview(Sized, Sequence[int]): @final class bool(int): def __new__(cls: Type[_T], __o: object = ...) -> _T: ... - @overload - def __and__(self, __x: bool) -> bool: ... - @overload - def __and__(self, __x: int) -> int: ... - @overload - def __or__(self, __x: bool) -> bool: ... - @overload - def __or__(self, __x: int) -> int: ... - @overload - def __xor__(self, __x: bool) -> bool: ... - @overload - def __xor__(self, __x: int) -> int: ... - @overload - def __rand__(self, __x: bool) -> bool: ... - @overload - def __rand__(self, __x: int) -> int: ... - @overload - def __ror__(self, __x: bool) -> bool: ... - @overload - def __ror__(self, __x: int) -> int: ... - @overload - def __rxor__(self, __x: bool) -> bool: ... - @overload - def __rxor__(self, __x: int) -> int: ... + def __and__(self, __x: _B) -> _B: ... + def __or__(self, __x: _B) -> _B: ... + def __xor__(self, __x: _B) -> _B: ... + def __rand__(self, __x: _B) -> _B: ... + def __ror__(self, __x: _B) -> _B: ... + def __rxor__(self, __x: _B) -> _B: ... def __getnewargs__(self) -> tuple[int]: ... @final