Add typings for bool __{r,}{and,or,xor}__ (#1795)

This commit is contained in:
Anthony Sottile
2017-12-20 21:04:55 -08:00
committed by Jelle Zijlstra
parent 64ca731d0b
commit 03044212d4
2 changed files with 48 additions and 0 deletions

View File

@@ -472,6 +472,30 @@ class bytearray(MutableSequence[int]):
class bool(int):
def __init__(self, o: object = ...) -> None: ...
@overload # type: ignore
def __and__(self, x: bool) -> bool: ...
@overload # type: ignore
def __and__(self, x: int) -> int: ...
@overload # type: ignore
def __or__(self, x: bool) -> bool: ...
@overload # type: ignore
def __or__(self, x: int) -> int: ...
@overload # type: ignore
def __xor__(self, x: bool) -> bool: ...
@overload # type: ignore
def __xor__(self, x: int) -> int: ...
@overload # type: ignore
def __rand__(self, x: bool) -> bool: ...
@overload # type: ignore
def __rand__(self, x: int) -> int: ...
@overload # type: ignore
def __ror__(self, x: bool) -> bool: ...
@overload # type: ignore
def __ror__(self, x: int) -> int: ...
@overload # type: ignore
def __rxor__(self, x: bool) -> bool: ...
@overload # type: ignore
def __rxor__(self, x: int) -> int: ...
class slice(object):
start = ... # type: Optional[int]

View File

@@ -537,6 +537,30 @@ class memoryview(Sized, Container[bytes]):
class bool(int):
def __init__(self, o: object = ...) -> None: ...
@overload # type: ignore
def __and__(self, x: bool) -> bool: ...
@overload # type: ignore
def __and__(self, x: int) -> int: ...
@overload # type: ignore
def __or__(self, x: bool) -> bool: ...
@overload # type: ignore
def __or__(self, x: int) -> int: ...
@overload # type: ignore
def __xor__(self, x: bool) -> bool: ...
@overload # type: ignore
def __xor__(self, x: int) -> int: ...
@overload # type: ignore
def __rand__(self, x: bool) -> bool: ...
@overload # type: ignore
def __rand__(self, x: int) -> int: ...
@overload # type: ignore
def __ror__(self, x: bool) -> bool: ...
@overload # type: ignore
def __ror__(self, x: int) -> int: ...
@overload # type: ignore
def __rxor__(self, x: bool) -> bool: ...
@overload # type: ignore
def __rxor__(self, x: int) -> int: ...
class slice:
start = ... # type: Optional[int]