Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions stdlib/_operator.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ from typing import (
SupportsAbs,
Tuple,
TypeVar,
Union,
overload,
)
from typing_extensions import ParamSpec, SupportsIndex, final
Expand All @@ -34,12 +35,27 @@ class _SupportsNeg(Protocol[_T_co]):
class _SupportsPos(Protocol[_T_co]):
def __pos__(self) -> _T_co: ...

def lt(__a: Any, __b: Any) -> Any: ...
def le(__a: Any, __b: Any) -> Any: ...
# Different to _typeshed.SupportsLessThan
class _SupportsLT(Protocol):
def __lt__(self, other: Any) -> Any: ...

class _SupportsGT(Protocol):
def __gt__(self, other: Any) -> Any: ...

class _SupportsLE(Protocol):
def __le__(self, other: Any) -> Any: ...

class _SupportsGE(Protocol):
def __ge__(self, other: Any) -> Any: ...

_SupportsComparison = Union[_SupportsLE, _SupportsGE, _SupportsGT, _SupportsLT]

def lt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def le(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def eq(__a: object, __b: object) -> Any: ...
def ne(__a: object, __b: object) -> Any: ...
def ge(__a: Any, __b: Any) -> Any: ...
def gt(__a: Any, __b: Any) -> Any: ...
def ge(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def gt(__a: _SupportsComparison, __b: _SupportsComparison) -> Any: ...
def not_(__a: object) -> bool: ...
def truth(__a: object) -> bool: ...
def is_(__a: object, __b: object) -> bool: ...
Expand Down