Improve unary-operator functions in operator (#6452)

This commit is contained in:
Alex Waygood
2021-11-30 15:38:35 +00:00
committed by GitHub
parent 9ccfc587d8
commit 93cb52b929

View File

@@ -9,6 +9,7 @@ from typing import (
Mapping,
MutableMapping,
MutableSequence,
Protocol,
Sequence,
SupportsAbs,
Tuple,
@@ -24,6 +25,15 @@ _K = TypeVar("_K")
_V = TypeVar("_V")
_P = ParamSpec("_P")
class _SupportsInversion(Protocol[_T_co]):
def __invert__(self) -> _T_co: ...
class _SupportsNeg(Protocol[_T_co]):
def __neg__(self) -> _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: ...
def eq(__a: object, __b: object) -> Any: ...
@@ -39,15 +49,15 @@ def add(__a: Any, __b: Any) -> Any: ...
def and_(__a: Any, __b: Any) -> Any: ...
def floordiv(__a: Any, __b: Any) -> Any: ...
def index(__a: Any) -> int: ...
def inv(__a: Any) -> Any: ...
def invert(__a: Any) -> Any: ...
def inv(__a: _SupportsInversion[_T_co]) -> _T_co: ...
def invert(__a: _SupportsInversion[_T_co]) -> _T_co: ...
def lshift(__a: Any, __b: Any) -> Any: ...
def mod(__a: Any, __b: Any) -> Any: ...
def mul(__a: Any, __b: Any) -> Any: ...
def matmul(__a: Any, __b: Any) -> Any: ...
def neg(__a: Any) -> Any: ...
def neg(__a: _SupportsNeg[_T_co]) -> _T_co: ...
def or_(__a: Any, __b: Any) -> Any: ...
def pos(__a: Any) -> Any: ...
def pos(__a: _SupportsPos[_T_co]) -> _T_co: ...
def pow(__a: Any, __b: Any) -> Any: ...
def rshift(__a: Any, __b: Any) -> Any: ...
def sub(__a: Any, __b: Any) -> Any: ...