diff --git a/stdlib/_operator.pyi b/stdlib/_operator.pyi index a945a0be7..b8c71852c 100644 --- a/stdlib/_operator.pyi +++ b/stdlib/_operator.pyi @@ -37,17 +37,19 @@ class _SupportsPos(Protocol[_T_co]): # Different to _typeshed.SupportsLessThan class _SupportsLT(Protocol): - def __lt__(self, other: Any) -> Any: ... + def __lt__(self, __other: Any) -> Any: ... class _SupportsGT(Protocol): - def __gt__(self, other: Any) -> Any: ... + def __gt__(self, __other: Any) -> Any: ... class _SupportsLE(Protocol): - def __le__(self, other: Any) -> Any: ... + def __le__(self, __other: Any) -> Any: ... class _SupportsGE(Protocol): - def __ge__(self, other: Any) -> Any: ... + def __ge__(self, __other: Any) -> Any: ... +# We get false-positive errors if e.g. `lt` does not have the same signature as `le`, +# so a broad union type is required for all four comparison methods _SupportsComparison = Union[_SupportsLE, _SupportsGE, _SupportsGT, _SupportsLT] def lt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...