Skip to content

Commit e90a47d

Browse files
committed
Add __rsub__ method to AbstractSet
1 parent ba37bf7 commit e90a47d

File tree

5 files changed

+3
-3
lines changed

5 files changed

+3
-3
lines changed

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ _collections_abc.Mapping.__reversed__ # set to None at runtime for a better err
5151
# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414.
5252
_collections_abc.Set.__rand__
5353
_collections_abc.Set.__ror__
54-
_collections_abc.Set.__rsub__
5554
_collections_abc.Set.__rxor__
5655

5756
# Undocumented implementation details of a deprecated class

stdlib/@tests/stubtest_allowlists/py39.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ collections.Mapping.__reversed__ # Set to None at runtime for a better error me
140140
# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414.
141141
collections.Set.__rand__
142142
collections.Set.__ror__
143-
collections.Set.__rsub__
144143
collections.Set.__rxor__
145144

146145
ssl.RAND_egd # Depends on the existence and flags of SSL

stdlib/builtins.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ class set(MutableSet[_T]):
12671267
def __ior__(self, value: AbstractSet[_T], /) -> Self: ... # type: ignore[override,misc]
12681268
def __sub__(self, value: AbstractSet[_T | None], /) -> set[_T]: ... # type: ignore[override,misc]
12691269
def __isub__(self, value: AbstractSet[object], /) -> Self: ... # type: ignore[override,misc]
1270+
def __rsub__(self, value: AbstractSet[_S], /) -> set[_S]: ... # type: ignore[override,misc]
12701271
def __xor__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[override,misc]
12711272
def __ixor__(self, value: AbstractSet[_T], /) -> Self: ... # type: ignore[override,misc]
12721273
def __le__(self, value: AbstractSet[object], /) -> bool: ...

stdlib/multiprocessing/managers.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if sys.version_info >= (3, 14):
162162
def __eq__(self, value: object, /) -> bool: ...
163163
def __rand__(self, value: AbstractSet[object], /) -> set[_T]: ...
164164
def __ror__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[misc]
165-
def __rsub__(self, value: AbstractSet[_T], /) -> set[_T]: ...
165+
def __rsub__(self, value: AbstractSet[_T], /) -> set[_T]: ... # type: ignore[override,misc]
166166
def __rxor__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... # type: ignore[misc]
167167
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
168168

stdlib/typing.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ class AbstractSet(Collection[_T_co]):
707707
def __and__(self, other: Iterable[Any]) -> AbstractSet[_T_co]: ...
708708
def __or__(self, other: Iterable[_T]) -> AbstractSet[_T_co | _T]: ...
709709
def __sub__(self, other: Iterable[Any]) -> AbstractSet[_T_co]: ...
710+
def __rsub__(self, other: Iterable[_T]) -> AbstractSet[_T]: ...
710711
def __xor__(self, other: Iterable[_T]) -> AbstractSet[_T_co | _T]: ...
711712
def __eq__(self, other: object) -> bool: ...
712713
def isdisjoint(self, other: Iterable[Any]) -> bool: ...

0 commit comments

Comments
 (0)