| 1 |
# NOTE: Requires fixtures/dict.pyi |
| 2 |
from typing import ( |
| 3 |
Any, Dict, Type, TypeVar, Optional, Any, Generic, Mapping, NoReturn as NoReturn, Iterator, |
| 4 |
Union, Protocol |
| 5 |
) |
| 6 |
|
| 7 |
_T = TypeVar('_T') |
| 8 |
_U = TypeVar('_U') |
| 9 |
|
| 10 |
|
| 11 |
def Arg(type: _T = ..., name: Optional[str] = ...) -> _T: ... |
| 12 |
|
| 13 |
def DefaultArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... |
| 14 |
|
| 15 |
def NamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... |
| 16 |
|
| 17 |
def DefaultNamedArg(type: _T = ..., name: Optional[str] = ...) -> _T: ... |
| 18 |
|
| 19 |
def VarArg(type: _T = ...) -> _T: ... |
| 20 |
|
| 21 |
def KwArg(type: _T = ...) -> _T: ... |
| 22 |
|
| 23 |
|
| 24 |
# Fallback type for all typed dicts (does not exist at runtime). |
| 25 |
class _TypedDict(Mapping[str, object]): |
| 26 |
# Needed to make this class non-abstract. It is explicitly declared abstract in |
| 27 |
# typeshed, but we don't want to import abc here, as it would slow down the tests. |
| 28 |
def __iter__(self) -> Iterator[str]: ... |
| 29 |
def copy(self: _T) -> _T: ... |
| 30 |
# Using NoReturn so that only calls using the plugin hook can go through. |
| 31 |
def setdefault(self, k: NoReturn, default: object) -> object: ... |
| 32 |
# Mypy expects that 'default' has a type variable type. |
| 33 |
def pop(self, k: NoReturn, default: _T = ...) -> object: ... |
| 34 |
def update(self: _T, __m: _T) -> None: ... |
| 35 |
def __delitem__(self, k: NoReturn) -> None: ... |
| 36 |
|
| 37 |
def TypedDict(typename: str, fields: Dict[str, Type[_T]], *, total: Any = ...) -> Type[dict]: ... |
| 38 |
|
| 39 |
# This is intended as a class decorator, but mypy rejects abstract classes |
| 40 |
# when a Type[_T] is expected, so we can't give it the type we want. |
| 41 |
def trait(cls: Any) -> Any: ... |
| 42 |
|
| 43 |
# The real type is in the comment but it isn't safe to use **kwargs in |
| 44 |
# a lib-stub because the fixtures might not have dict. Argh! |
| 45 |
# def mypyc_attr(*attrs: str, **kwattrs: object) -> Callable[[_T], _T]: ... |
| 46 |
mypyc_attr: Any |
| 47 |
|
| 48 |
class FlexibleAlias(Generic[_T, _U]): ... |
| 49 |
|
| 50 |
class __SupportsInt(Protocol[T_co]): |
| 51 |
def __int__(self) -> int: pass |
| 52 |
|
| 53 |
_Int = Union[int, u8, i16, i32, i64] |
| 54 |
|
| 55 |
class u8: |
| 56 |
def __init__(self, x: Union[_Int, str, bytes, SupportsInt], base: int = 10) -> None: ... |
| 57 |
def __add__(self, x: u8) -> u8: ... |
| 58 |
def __radd__(self, x: u8) -> u8: ... |
| 59 |
def __sub__(self, x: u8) -> u8: ... |
| 60 |
def __rsub__(self, x: u8) -> u8: ... |
| 61 |
def __mul__(self, x: u8) -> u8: ... |
| 62 |
def __rmul__(self, x: u8) -> u8: ... |
| 63 |
def __floordiv__(self, x: u8) -> u8: ... |
| 64 |
def __rfloordiv__(self, x: u8) -> u8: ... |
| 65 |
def __mod__(self, x: u8) -> u8: ... |
| 66 |
def __rmod__(self, x: u8) -> u8: ... |
| 67 |
def __and__(self, x: u8) -> u8: ... |
| 68 |
def __rand__(self, x: u8) -> u8: ... |
| 69 |
def __or__(self, x: u8) -> u8: ... |
| 70 |
def __ror__(self, x: u8) -> u8: ... |
| 71 |
def __xor__(self, x: u8) -> u8: ... |
| 72 |
def __rxor__(self, x: u8) -> u8: ... |
| 73 |
def __lshift__(self, x: u8) -> u8: ... |
| 74 |
def __rlshift__(self, x: u8) -> u8: ... |
| 75 |
def __rshift__(self, x: u8) -> u8: ... |
| 76 |
def __rrshift__(self, x: u8) -> u8: ... |
| 77 |
def __neg__(self) -> u8: ... |
| 78 |
def __invert__(self) -> u8: ... |
| 79 |
def __pos__(self) -> u8: ... |
| 80 |
def __lt__(self, x: u8) -> bool: ... |
| 81 |
def __le__(self, x: u8) -> bool: ... |
| 82 |
def __ge__(self, x: u8) -> bool: ... |
| 83 |
def __gt__(self, x: u8) -> bool: ... |
| 84 |
|
| 85 |
class i16: |
| 86 |
def __init__(self, x: Union[_Int, str, bytes, SupportsInt], base: int = 10) -> None: ... |
| 87 |
def __add__(self, x: i16) -> i16: ... |
| 88 |
def __radd__(self, x: i16) -> i16: ... |
| 89 |
def __sub__(self, x: i16) -> i16: ... |
| 90 |
def __rsub__(self, x: i16) -> i16: ... |
| 91 |
def __mul__(self, x: i16) -> i16: ... |
| 92 |
def __rmul__(self, x: i16) -> i16: ... |
| 93 |
def __floordiv__(self, x: i16) -> i16: ... |
| 94 |
def __rfloordiv__(self, x: i16) -> i16: ... |
| 95 |
def __mod__(self, x: i16) -> i16: ... |
| 96 |
def __rmod__(self, x: i16) -> i16: ... |
| 97 |
def __and__(self, x: i16) -> i16: ... |
| 98 |
def __rand__(self, x: i16) -> i16: ... |
| 99 |
def __or__(self, x: i16) -> i16: ... |
| 100 |
def __ror__(self, x: i16) -> i16: ... |
| 101 |
def __xor__(self, x: i16) -> i16: ... |
| 102 |
def __rxor__(self, x: i16) -> i16: ... |
| 103 |
def __lshift__(self, x: i16) -> i16: ... |
| 104 |
def __rlshift__(self, x: i16) -> i16: ... |
| 105 |
def __rshift__(self, x: i16) -> i16: ... |
| 106 |
def __rrshift__(self, x: i16) -> i16: ... |
| 107 |
def __neg__(self) -> i16: ... |
| 108 |
def __invert__(self) -> i16: ... |
| 109 |
def __pos__(self) -> i16: ... |
| 110 |
def __lt__(self, x: i16) -> bool: ... |
| 111 |
def __le__(self, x: i16) -> bool: ... |
| 112 |
def __ge__(self, x: i16) -> bool: ... |
| 113 |
def __gt__(self, x: i16) -> bool: ... |
| 114 |
|
| 115 |
class i32: |
| 116 |
def __init__(self, x: Union[_Int, str, bytes, SupportsInt], base: int = 10) -> None: ... |
| 117 |
def __add__(self, x: i32) -> i32: ... |
| 118 |
def __radd__(self, x: i32) -> i32: ... |
| 119 |
def __sub__(self, x: i32) -> i32: ... |
| 120 |
def __rsub__(self, x: i32) -> i32: ... |
| 121 |
def __mul__(self, x: i32) -> i32: ... |
| 122 |
def __rmul__(self, x: i32) -> i32: ... |
| 123 |
def __floordiv__(self, x: i32) -> i32: ... |
| 124 |
def __rfloordiv__(self, x: i32) -> i32: ... |
| 125 |
def __mod__(self, x: i32) -> i32: ... |
| 126 |
def __rmod__(self, x: i32) -> i32: ... |
| 127 |
def __and__(self, x: i32) -> i32: ... |
| 128 |
def __rand__(self, x: i32) -> i32: ... |
| 129 |
def __or__(self, x: i32) -> i32: ... |
| 130 |
def __ror__(self, x: i32) -> i32: ... |
| 131 |
def __xor__(self, x: i32) -> i32: ... |
| 132 |
def __rxor__(self, x: i32) -> i32: ... |
| 133 |
def __lshift__(self, x: i32) -> i32: ... |
| 134 |
def __rlshift__(self, x: i32) -> i32: ... |
| 135 |
def __rshift__(self, x: i32) -> i32: ... |
| 136 |
def __rrshift__(self, x: i32) -> i32: ... |
| 137 |
def __neg__(self) -> i32: ... |
| 138 |
def __invert__(self) -> i32: ... |
| 139 |
def __pos__(self) -> i32: ... |
| 140 |
def __lt__(self, x: i32) -> bool: ... |
| 141 |
def __le__(self, x: i32) -> bool: ... |
| 142 |
def __ge__(self, x: i32) -> bool: ... |
| 143 |
def __gt__(self, x: i32) -> bool: ... |
| 144 |
|
| 145 |
class i64: |
| 146 |
def __init__(self, x: Union[_Int, str, bytes, SupportsInt], base: int = 10) -> None: ... |
| 147 |
def __add__(self, x: i64) -> i64: ... |
| 148 |
def __radd__(self, x: i64) -> i64: ... |
| 149 |
def __sub__(self, x: i64) -> i64: ... |
| 150 |
def __rsub__(self, x: i64) -> i64: ... |
| 151 |
def __mul__(self, x: i64) -> i64: ... |
| 152 |
def __rmul__(self, x: i64) -> i64: ... |
| 153 |
def __floordiv__(self, x: i64) -> i64: ... |
| 154 |
def __rfloordiv__(self, x: i64) -> i64: ... |
| 155 |
def __mod__(self, x: i64) -> i64: ... |
| 156 |
def __rmod__(self, x: i64) -> i64: ... |
| 157 |
def __and__(self, x: i64) -> i64: ... |
| 158 |
def __rand__(self, x: i64) -> i64: ... |
| 159 |
def __or__(self, x: i64) -> i64: ... |
| 160 |
def __ror__(self, x: i64) -> i64: ... |
| 161 |
def __xor__(self, x: i64) -> i64: ... |
| 162 |
def __rxor__(self, x: i64) -> i64: ... |
| 163 |
def __lshift__(self, x: i64) -> i64: ... |
| 164 |
def __rlshift__(self, x: i64) -> i64: ... |
| 165 |
def __rshift__(self, x: i64) -> i64: ... |
| 166 |
def __rrshift__(self, x: i64) -> i64: ... |
| 167 |
def __neg__(self) -> i64: ... |
| 168 |
def __invert__(self) -> i64: ... |
| 169 |
def __pos__(self) -> i64: ... |
| 170 |
def __lt__(self, x: i64) -> bool: ... |
| 171 |
def __le__(self, x: i64) -> bool: ... |
| 172 |
def __ge__(self, x: i64) -> bool: ... |
| 173 |
def __gt__(self, x: i64) -> bool: ... |