Skip to content

Commit a5633e3

Browse files
committed
Revert "Add typeguards to builtins equality"
This reverts commit 68c0e1d.
1 parent daf9eb4 commit a5633e3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

stdlib/builtins.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ class str(Sequence[str]):
630630
def __add__(self, value: str, /) -> str: ... # type: ignore[misc]
631631
# Incompatible with Sequence.__contains__
632632
def __contains__(self, key: str, /) -> bool: ... # type: ignore[override]
633-
def __eq__(self, value: object, /) -> TypeGuard[str]: ...
633+
def __eq__(self, value: object, /) -> bool: ...
634634
def __ge__(self, value: str, /) -> bool: ...
635635
@overload
636636
def __getitem__(self: LiteralString, key: SupportsIndex | slice[SupportsIndex | None], /) -> LiteralString: ...
@@ -753,7 +753,7 @@ class bytes(Sequence[int]):
753753
def __mod__(self, value: Any, /) -> bytes: ...
754754
# Incompatible with Sequence.__contains__
755755
def __contains__(self, key: SupportsIndex | ReadableBuffer, /) -> bool: ... # type: ignore[override]
756-
def __eq__(self, value: object, /) -> TypeGuard[bytes]: ...
756+
def __eq__(self, value: object, /) -> bool: ...
757757
def __ne__(self, value: object, /) -> bool: ...
758758
def __lt__(self, value: bytes, /) -> bool: ...
759759
def __le__(self, value: bytes, /) -> bool: ...
@@ -1053,7 +1053,7 @@ class tuple(Sequence[_T_co]):
10531053
def __le__(self, value: tuple[_T_co, ...], /) -> bool: ...
10541054
def __gt__(self, value: tuple[_T_co, ...], /) -> bool: ...
10551055
def __ge__(self, value: tuple[_T_co, ...], /) -> bool: ...
1056-
def __eq__(self, value: object, /) -> TypeGuard[tuple]: ...
1056+
def __eq__(self, value: object, /) -> bool: ...
10571057
def __hash__(self) -> int: ...
10581058
@overload
10591059
def __add__(self, value: tuple[_T_co, ...], /) -> tuple[_T_co, ...]: ...
@@ -1168,7 +1168,7 @@ class list(MutableSequence[_T]):
11681168
def __ge__(self, value: list[_T], /) -> bool: ...
11691169
def __lt__(self, value: list[_T], /) -> bool: ...
11701170
def __le__(self, value: list[_T], /) -> bool: ...
1171-
def __eq__(self, value: object, /) -> TypeGuard[list]: ...
1171+
def __eq__(self, value: object, /) -> bool: ...
11721172
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
11731173

11741174
@disjoint_base
@@ -1236,7 +1236,7 @@ class dict(MutableMapping[_KT, _VT]):
12361236
def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
12371237
def __delitem__(self, key: _KT, /) -> None: ...
12381238
def __iter__(self) -> Iterator[_KT]: ...
1239-
def __eq__(self, value: object, /) -> TypeGuard[dict]: ...
1239+
def __eq__(self, value: object, /) -> bool: ...
12401240
def __reversed__(self) -> Iterator[_KT]: ...
12411241
__hash__: ClassVar[None] # type: ignore[assignment]
12421242
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
@@ -1290,7 +1290,7 @@ class set(MutableSet[_T]):
12901290
def __lt__(self, value: AbstractSet[object], /) -> bool: ...
12911291
def __ge__(self, value: AbstractSet[object], /) -> bool: ...
12921292
def __gt__(self, value: AbstractSet[object], /) -> bool: ...
1293-
def __eq__(self, value: object, /) -> TypeGuard[set]: ...
1293+
def __eq__(self, value: object, /) -> bool: ...
12941294
__hash__: ClassVar[None] # type: ignore[assignment]
12951295
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
12961296

@@ -1319,7 +1319,7 @@ class frozenset(AbstractSet[_T_co]):
13191319
def __lt__(self, value: AbstractSet[object], /) -> bool: ...
13201320
def __ge__(self, value: AbstractSet[object], /) -> bool: ...
13211321
def __gt__(self, value: AbstractSet[object], /) -> bool: ...
1322-
def __eq__(self, value: object, /) -> TypeGuard[frozenset]: ...
1322+
def __eq__(self, value: object, /) -> bool: ...
13231323
def __hash__(self) -> int: ...
13241324
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
13251325

0 commit comments

Comments
 (0)