mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 04:41:30 +08:00
Improve unary-operator functions in operator (#6452)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user