diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 903b13aa460a..40a8eff45073 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1455,12 +1455,16 @@ class set(MutableSet[_T]): def __contains__(self, o: object, /) -> bool: ... def __iter__(self) -> Iterator[_T]: ... def __and__(self, value: AbstractSet[object], /) -> set[_T]: ... + def __rand__(self, value: AbstractSet[object], /) -> set[_T]: ... def __iand__(self, value: AbstractSet[object], /) -> Self: ... def __or__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... + def __ror__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[misc] def __ior__(self, value: AbstractSet[_T], /) -> Self: ... # type: ignore[override,misc] def __sub__(self, value: AbstractSet[object], /) -> set[_T]: ... + def __rsub__(self, value: AbstractSet[_S], /) -> set[_S]: ... # type: ignore[override,misc] def __isub__(self, value: AbstractSet[object], /) -> Self: ... def __xor__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... + def __rxor__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[misc] def __ixor__(self, value: AbstractSet[_T], /) -> Self: ... # type: ignore[override,misc] def __le__(self, value: AbstractSet[object], /) -> bool: ... def __lt__(self, value: AbstractSet[object], /) -> bool: ... @@ -1489,9 +1493,13 @@ class frozenset(AbstractSet[_T_co]): def __contains__(self, o: object, /) -> bool: ... def __iter__(self) -> Iterator[_T_co]: ... def __and__(self, value: AbstractSet[object], /) -> frozenset[_T_co]: ... + def __rand__(self, value: AbstractSet[object], /) -> frozenset[_T_co]: ... def __or__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: ... + def __ror__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: ... # type: ignore[misc] def __sub__(self, value: AbstractSet[object], /) -> frozenset[_T_co]: ... + def __rsub__(self, value: AbstractSet[_S], /) -> frozenset[_S]: ... # type: ignore[override,misc] def __xor__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: ... + def __rxor__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: ... # type: ignore[misc] def __le__(self, value: AbstractSet[object], /) -> bool: ... def __lt__(self, value: AbstractSet[object], /) -> bool: ... def __ge__(self, value: AbstractSet[object], /) -> bool: ... diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 0f1d4e87b0dc..9e126aeac846 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -194,7 +194,7 @@ if sys.version_info >= (3, 14): def __eq__(self, value: object, /) -> bool: ... def __rand__(self, value: AbstractSet[object], /) -> set[_T]: ... def __ror__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[misc] - def __rsub__(self, value: AbstractSet[_T], /) -> set[_T]: ... + def __rsub__(self, value: AbstractSet[_T], /) -> set[_T]: ... # type: ignore[override] def __rxor__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[misc] def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 213346ab5fe2..49ad052bdeff 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -739,9 +739,13 @@ class AbstractSet(Collection[_T_co]): def __gt__(self, other: AbstractSet[Any], /) -> bool: ... def __ge__(self, other: AbstractSet[Any], /) -> bool: ... def __and__(self, other: AbstractSet[Any], /) -> AbstractSet[_T_co]: ... + def __rand__(self, other: AbstractSet[Any], /) -> AbstractSet[_T_co]: ... def __or__(self, other: AbstractSet[_T], /) -> AbstractSet[_T_co | _T]: ... + def __ror__(self, other: AbstractSet[_T], /) -> AbstractSet[_T_co | _T]: ... def __sub__(self, other: AbstractSet[Any], /) -> AbstractSet[_T_co]: ... + def __rsub__(self, other: Iterable[_T], /) -> AbstractSet[_T]: ... def __xor__(self, other: AbstractSet[_T], /) -> AbstractSet[_T_co | _T]: ... + def __rxor__(self, other: AbstractSet[_T], /) -> AbstractSet[_T_co | _T]: ... def __eq__(self, other: object, /) -> bool: ... def isdisjoint(self, other: Iterable[Any], /) -> bool: ... diff --git a/stubs/boltons/boltons/setutils.pyi b/stubs/boltons/boltons/setutils.pyi index d94de1967fc0..92a3945bdae0 100644 --- a/stubs/boltons/boltons/setutils.pyi +++ b/stubs/boltons/boltons/setutils.pyi @@ -40,7 +40,7 @@ class IndexedSet(MutableSet[Any]): # __sub__ = difference # __xor__ = symmetric_difference __rxor__ = symmetric_difference - def __rsub__(self, other: _RSub[_T_co]) -> _RSub[_T_co]: ... + def __rsub__(self, other: _RSub[_T_co]) -> _RSub[_T_co]: ... # type: ignore[override] def update(self, *others: Iterable[Any]) -> None: ... def intersection_update(self, *others: Iterable[Any]) -> None: ... def difference_update(self, *others: Container[Any]) -> None: ...