1 # Stubs for builtins (Python 3)
\r
4 TypeVar, Iterator, Iterable, overload, Container,
\r
5 Sequence, MutableSequence, Mapping, MutableMapping, NoReturn, Tuple, List, Any, Dict, Callable, Generic,
\r
6 Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat,
\r
7 SupportsComplex, SupportsBytes, SupportsAbs, SupportsRound, IO, Union, ItemsView, KeysView,
\r
8 ValuesView, ByteString, Optional, AnyStr, Type,
\r
10 from abc import abstractmethod, ABCMeta
\r
11 from types import TracebackType, CodeType
\r
14 # Note that names imported above are not automatically made visible via the
\r
15 # implicit builtins import.
\r
18 _T_co = TypeVar('_T_co', covariant=True)
\r
19 _KT = TypeVar('_KT')
\r
20 _VT = TypeVar('_VT')
\r
22 _T1 = TypeVar('_T1')
\r
23 _T2 = TypeVar('_T2')
\r
24 _T3 = TypeVar('_T3')
\r
25 _T4 = TypeVar('_T4')
\r
26 _T5 = TypeVar('_T5')
\r
27 _TT = TypeVar('_TT', bound='type')
\r
30 __doc__ = ... # type: Optional[str]
\r
31 __class__ = ... # type: type
\r
32 __dict__ = ... # type: Dict[str, Any]
\r
33 __slots__ = ... # type: Union[str, Iterable[str]]
\r
34 __module__ = ... # type: str
\r
35 if sys.version_info >= (3, 6):
\r
36 __annotations__ = ... # type: Dict[str, Any]
\r
38 def __init__(self) -> None: ...
\r
39 def __new__(cls) -> Any: ...
\r
40 def __setattr__(self, name: str, value: Any) -> None: ...
\r
41 def __eq__(self, o: object) -> bool: ...
\r
42 def __ne__(self, o: object) -> bool: ...
\r
43 def __str__(self) -> str: ...
\r
44 def __repr__(self) -> str: ...
\r
45 def __hash__(self) -> int: ...
\r
46 def __format__(self, format_spec: str) -> str: ...
\r
47 def __getattribute__(self, name: str) -> Any: ...
\r
48 def __delattr__(self, name: str) -> None: ...
\r
49 def __sizeof__(self) -> int: ...
\r
50 def __reduce__(self) -> tuple: ...
\r
51 def __reduce_ex__(self, protocol: int) -> tuple: ...
\r
52 def __dir__(self) -> Iterable[str]: ...
\r
54 if sys.version_info >= (3, 6):
\r
55 def __init_subclass__(cls) -> None: ...
\r
57 class staticmethod: # Special, only valid as a decorator.
\r
58 __func__ = ... # type: function
\r
59 __isabstractmethod__ = ... # type: bool
\r
61 def __init__(self, f: function) -> None: ...
\r
62 def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
\r
63 def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
\r
65 class classmethod: # Special, only valid as a decorator.
\r
66 __func__ = ... # type: function
\r
67 __isabstractmethod__ = ... # type: bool
\r
69 def __init__(self, f: function) -> None: ...
\r
70 def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
\r
71 def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
\r
74 __bases__ = ... # type: Tuple[type, ...]
\r
75 __name__ = ... # type: str
\r
76 __qualname__ = ... # type: str
\r
77 __module__ = ... # type: str
\r
78 __dict__ = ... # type: Dict[str, Any]
\r
79 __mro__ = ... # type: Tuple[type, ...]
\r
82 def __init__(self, o: object) -> None: ...
\r
84 def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ...
\r
86 def __new__(cls, o: object) -> type: ...
\r
88 def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ...
\r
89 def __call__(self, *args: Any, **kwds: Any) -> Any: ...
\r
90 def __subclasses__(self: _TT) -> List[_TT]: ...
\r
91 # Note: the documentation doesnt specify what the return type is, the standard
\r
92 # implementation seems to be returning a list.
\r
93 def mro(self) -> List[type]: ...
\r
94 def __instancecheck__(self, instance: Any) -> bool: ...
\r
95 def __subclasscheck__(self, subclass: type) -> bool: ...
\r
99 def __init__(self, t: Any, obj: Any) -> None: ...
\r
101 def __init__(self, t: Any) -> None: ...
\r
103 def __init__(self) -> None: ...
\r
107 def __init__(self, x: Union[str, bytes, SupportsInt] = ...) -> None: ...
\r
109 def __init__(self, x: Union[str, bytes], base: int) -> None: ...
\r
111 def bit_length(self) -> int: ...
\r
112 def to_bytes(self, length: int, byteorder: str, *, signed: bool = ...) -> bytes: ...
\r
114 def from_bytes(cls, bytes: Sequence[int], byteorder: str, *,
\r
115 signed: bool = ...) -> int: ... # TODO buffer object argument
\r
117 def __add__(self, x: int) -> int: ...
\r
118 def __sub__(self, x: int) -> int: ...
\r
119 def __mul__(self, x: int) -> int: ...
\r
120 def __floordiv__(self, x: int) -> int: ...
\r
121 def __truediv__(self, x: int) -> float: ...
\r
122 def __mod__(self, x: int) -> int: ...
\r
123 def __divmod__(self, x: int) -> Tuple[int, int]: ...
\r
124 def __radd__(self, x: int) -> int: ...
\r
125 def __rsub__(self, x: int) -> int: ...
\r
126 def __rmul__(self, x: int) -> int: ...
\r
127 def __rfloordiv__(self, x: int) -> int: ...
\r
128 def __rtruediv__(self, x: int) -> float: ...
\r
129 def __rmod__(self, x: int) -> int: ...
\r
130 def __rdivmod__(self, x: int) -> Tuple[int, int]: ...
\r
131 def __pow__(self, x: int) -> Any: ... # Return type can be int or float, depending on x.
\r
132 def __rpow__(self, x: int) -> Any: ...
\r
133 def __and__(self, n: int) -> int: ...
\r
134 def __or__(self, n: int) -> int: ...
\r
135 def __xor__(self, n: int) -> int: ...
\r
136 def __lshift__(self, n: int) -> int: ...
\r
137 def __rshift__(self, n: int) -> int: ...
\r
138 def __rand__(self, n: int) -> int: ...
\r
139 def __ror__(self, n: int) -> int: ...
\r
140 def __rxor__(self, n: int) -> int: ...
\r
141 def __rlshift__(self, n: int) -> int: ...
\r
142 def __rrshift__(self, n: int) -> int: ...
\r
143 def __neg__(self) -> int: ...
\r
144 def __pos__(self) -> int: ...
\r
145 def __invert__(self) -> int: ...
\r
146 def __round__(self, ndigits: Optional[int] = ...) -> int: ...
\r
148 def __eq__(self, x: object) -> bool: ...
\r
149 def __ne__(self, x: object) -> bool: ...
\r
150 def __lt__(self, x: int) -> bool: ...
\r
151 def __le__(self, x: int) -> bool: ...
\r
152 def __gt__(self, x: int) -> bool: ...
\r
153 def __ge__(self, x: int) -> bool: ...
\r
155 def __str__(self) -> str: ...
\r
156 def __float__(self) -> float: ...
\r
157 def __int__(self) -> int: ...
\r
158 def __abs__(self) -> int: ...
\r
159 def __hash__(self) -> int: ...
\r
160 def __bool__(self) -> bool: ...
\r
163 def __init__(self, x: Union[SupportsFloat, str, bytes] = ...) -> None: ...
\r
164 def as_integer_ratio(self) -> Tuple[int, int]: ...
\r
165 def hex(self) -> str: ...
\r
166 def is_integer(self) -> bool: ...
\r
168 def fromhex(cls, s: str) -> float: ...
\r
170 def __add__(self, x: float) -> float: ...
\r
171 def __sub__(self, x: float) -> float: ...
\r
172 def __mul__(self, x: float) -> float: ...
\r
173 def __floordiv__(self, x: float) -> float: ...
\r
174 def __truediv__(self, x: float) -> float: ...
\r
175 def __mod__(self, x: float) -> float: ...
\r
176 def __divmod__(self, x: float) -> Tuple[float, float]: ...
\r
177 def __pow__(self, x: float) -> float: ...
\r
178 def __radd__(self, x: float) -> float: ...
\r
179 def __rsub__(self, x: float) -> float: ...
\r
180 def __rmul__(self, x: float) -> float: ...
\r
181 def __rfloordiv__(self, x: float) -> float: ...
\r
182 def __rtruediv__(self, x: float) -> float: ...
\r
183 def __rmod__(self, x: float) -> float: ...
\r
184 def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
\r
185 def __rpow__(self, x: float) -> float: ...
\r
187 def __round__(self) -> int: ...
\r
189 def __round__(self, ndigits: None) -> int: ...
\r
191 def __round__(self, ndigits: int) -> float: ...
\r
193 def __eq__(self, x: object) -> bool: ...
\r
194 def __ne__(self, x: object) -> bool: ...
\r
195 def __lt__(self, x: float) -> bool: ...
\r
196 def __le__(self, x: float) -> bool: ...
\r
197 def __gt__(self, x: float) -> bool: ...
\r
198 def __ge__(self, x: float) -> bool: ...
\r
199 def __neg__(self) -> float: ...
\r
200 def __pos__(self) -> float: ...
\r
202 def __str__(self) -> str: ...
\r
203 def __int__(self) -> int: ...
\r
204 def __float__(self) -> float: ...
\r
205 def __abs__(self) -> float: ...
\r
206 def __hash__(self) -> int: ...
\r
207 def __bool__(self) -> bool: ...
\r
211 def __init__(self, re: float = ..., im: float = ...) -> None: ...
\r
213 def __init__(self, s: str) -> None: ...
\r
215 def __init__(self, s: SupportsComplex) -> None: ...
\r
218 def real(self) -> float: ...
\r
220 def imag(self) -> float: ...
\r
222 def conjugate(self) -> complex: ...
\r
224 def __add__(self, x: complex) -> complex: ...
\r
225 def __sub__(self, x: complex) -> complex: ...
\r
226 def __mul__(self, x: complex) -> complex: ...
\r
227 def __pow__(self, x: complex) -> complex: ...
\r
228 def __truediv__(self, x: complex) -> complex: ...
\r
229 def __radd__(self, x: complex) -> complex: ...
\r
230 def __rsub__(self, x: complex) -> complex: ...
\r
231 def __rmul__(self, x: complex) -> complex: ...
\r
232 def __rpow__(self, x: complex) -> complex: ...
\r
233 def __rtruediv__(self, x: complex) -> complex: ...
\r
235 def __eq__(self, x: object) -> bool: ...
\r
236 def __ne__(self, x: object) -> bool: ...
\r
237 def __neg__(self) -> complex: ...
\r
238 def __pos__(self) -> complex: ...
\r
240 def __str__(self) -> str: ...
\r
241 def __complex__(self) -> complex: ...
\r
242 def __abs__(self) -> float: ...
\r
243 def __hash__(self) -> int: ...
\r
244 def __bool__(self) -> bool: ...
\r
246 class str(Sequence[str]):
\r
248 def __init__(self, o: object = ...) -> None: ...
\r
250 def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ...
\r
252 def capitalize(self) -> str: ...
\r
253 def casefold(self) -> str: ...
\r
254 def center(self, width: int, fillchar: str = ...) -> str: ...
\r
255 def count(self, x: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
\r
256 def encode(self, encoding: str = ..., errors: str = ...) -> bytes: ...
\r
257 def endswith(self, suffix: Union[str, Tuple[str, ...]], start: Optional[int] = ...,
\r
258 end: Optional[int] = ...) -> bool: ...
\r
259 def expandtabs(self, tabsize: int = ...) -> str: ...
\r
260 def find(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
\r
261 def format(self, *args: Any, **kwargs: Any) -> str: ...
\r
262 def format_map(self, map: Mapping[str, Any]) -> str: ...
\r
263 def index(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
\r
264 def isalnum(self) -> bool: ...
\r
265 def isalpha(self) -> bool: ...
\r
266 def isdecimal(self) -> bool: ...
\r
267 def isdigit(self) -> bool: ...
\r
268 def isidentifier(self) -> bool: ...
\r
269 def islower(self) -> bool: ...
\r
270 def isnumeric(self) -> bool: ...
\r
271 def isprintable(self) -> bool: ...
\r
272 def isspace(self) -> bool: ...
\r
273 def istitle(self) -> bool: ...
\r
274 def isupper(self) -> bool: ...
\r
275 def join(self, iterable: Iterable[str]) -> str: ...
\r
276 def ljust(self, width: int, fillchar: str = ...) -> str: ...
\r
277 def lower(self) -> str: ...
\r
278 def lstrip(self, chars: Optional[str] = ...) -> str: ...
\r
279 def partition(self, sep: str) -> Tuple[str, str, str]: ...
\r
280 def replace(self, old: str, new: str, count: int = ...) -> str: ...
\r
281 def rfind(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
\r
282 def rindex(self, sub: str, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
\r
283 def rjust(self, width: int, fillchar: str = ...) -> str: ...
\r
284 def rpartition(self, sep: str) -> Tuple[str, str, str]: ...
\r
285 def rsplit(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ...
\r
286 def rstrip(self, chars: Optional[str] = ...) -> str: ...
\r
287 def split(self, sep: Optional[str] = ..., maxsplit: int = ...) -> List[str]: ...
\r
288 def splitlines(self, keepends: bool = ...) -> List[str]: ...
\r
289 def startswith(self, prefix: Union[str, Tuple[str, ...]], start: Optional[int] = ...,
\r
290 end: Optional[int] = ...) -> bool: ...
\r
291 def strip(self, chars: Optional[str] = ...) -> str: ...
\r
292 def swapcase(self) -> str: ...
\r
293 def title(self) -> str: ...
\r
294 def translate(self, table: Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]) -> str: ...
\r
295 def upper(self) -> str: ...
\r
296 def zfill(self, width: int) -> str: ...
\r
299 def maketrans(x: Union[Dict[int, _T], Dict[str, _T], Dict[Union[str, int], _T]]) -> Dict[int, _T]: ...
\r
302 def maketrans(x: str, y: str, z: str = ...) -> Dict[int, Union[int, None]]: ...
\r
304 def __getitem__(self, i: Union[int, slice]) -> str: ...
\r
305 def __add__(self, s: str) -> str: ...
\r
306 def __mul__(self, n: int) -> str: ...
\r
307 def __rmul__(self, n: int) -> str: ...
\r
308 def __mod__(self, value: Any) -> str: ...
\r
309 def __eq__(self, x: object) -> bool: ...
\r
310 def __ne__(self, x: object) -> bool: ...
\r
311 def __lt__(self, x: str) -> bool: ...
\r
312 def __le__(self, x: str) -> bool: ...
\r
313 def __gt__(self, x: str) -> bool: ...
\r
314 def __ge__(self, x: str) -> bool: ...
\r
316 def __len__(self) -> int: ...
\r
317 def __contains__(self, s: object) -> bool: ...
\r
318 def __iter__(self) -> Iterator[str]: ...
\r
319 def __str__(self) -> str: ...
\r
320 def __repr__(self) -> str: ...
\r
321 def __hash__(self) -> int: ...
\r
323 class bytes(ByteString):
\r
325 def __init__(self, ints: Iterable[int]) -> None: ...
\r
327 def __init__(self, string: str, encoding: str,
\r
328 errors: str = ...) -> None: ...
\r
330 def __init__(self, length: int) -> None: ...
\r
332 def __init__(self) -> None: ...
\r
334 def __init__(self, o: SupportsBytes) -> None: ...
\r
335 def capitalize(self) -> bytes: ...
\r
336 def center(self, width: int, fillchar: bytes = ...) -> bytes: ...
\r
337 def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
338 def decode(self, encoding: str = ..., errors: str = ...) -> str: ...
\r
339 def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ...
\r
340 def expandtabs(self, tabsize: int = ...) -> bytes: ...
\r
341 def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
342 if sys.version_info >= (3, 5):
\r
343 def hex(self) -> str: ...
\r
344 def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
345 def isalnum(self) -> bool: ...
\r
346 def isalpha(self) -> bool: ...
\r
347 def isdigit(self) -> bool: ...
\r
348 def islower(self) -> bool: ...
\r
349 def isspace(self) -> bool: ...
\r
350 def istitle(self) -> bool: ...
\r
351 def isupper(self) -> bool: ...
\r
352 def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytes: ...
\r
353 def ljust(self, width: int, fillchar: bytes = ...) -> bytes: ...
\r
354 def lower(self) -> bytes: ...
\r
355 def lstrip(self, chars: Optional[bytes] = ...) -> bytes: ...
\r
356 def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
\r
357 def replace(self, old: bytes, new: bytes, count: int = ...) -> bytes: ...
\r
358 def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
359 def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
360 def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ...
\r
361 def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
\r
362 def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ...
\r
363 def rstrip(self, chars: Optional[bytes] = ...) -> bytes: ...
\r
364 def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytes]: ...
\r
365 def splitlines(self, keepends: bool = ...) -> List[bytes]: ...
\r
366 def startswith(self, prefix: Union[bytes, Tuple[bytes, ...]]) -> bool: ...
\r
367 def strip(self, chars: Optional[bytes] = ...) -> bytes: ...
\r
368 def swapcase(self) -> bytes: ...
\r
369 def title(self) -> bytes: ...
\r
370 def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytes: ...
\r
371 def upper(self) -> bytes: ...
\r
372 def zfill(self, width: int) -> bytes: ...
\r
374 def fromhex(cls, s: str) -> bytes: ...
\r
376 def maketrans(cls, frm: bytes, to: bytes) -> bytes: ...
\r
378 def __len__(self) -> int: ...
\r
379 def __iter__(self) -> Iterator[int]: ...
\r
380 def __str__(self) -> str: ...
\r
381 def __repr__(self) -> str: ...
\r
382 def __int__(self) -> int: ...
\r
383 def __float__(self) -> float: ...
\r
384 def __hash__(self) -> int: ...
\r
386 def __getitem__(self, i: int) -> int: ...
\r
388 def __getitem__(self, s: slice) -> bytes: ...
\r
389 def __add__(self, s: bytes) -> bytes: ...
\r
390 def __mul__(self, n: int) -> bytes: ...
\r
391 def __rmul__(self, n: int) -> bytes: ...
\r
392 if sys.version_info >= (3, 5):
\r
393 def __mod__(self, value: Any) -> bytes: ...
\r
394 def __contains__(self, o: object) -> bool: ...
\r
395 def __eq__(self, x: object) -> bool: ...
\r
396 def __ne__(self, x: object) -> bool: ...
\r
397 def __lt__(self, x: bytes) -> bool: ...
\r
398 def __le__(self, x: bytes) -> bool: ...
\r
399 def __gt__(self, x: bytes) -> bool: ...
\r
400 def __ge__(self, x: bytes) -> bool: ...
\r
402 class bytearray(MutableSequence[int], ByteString):
\r
404 def __init__(self, ints: Iterable[int]) -> None: ...
\r
406 def __init__(self, string: str, encoding: str, errors: str = ...) -> None: ...
\r
408 def __init__(self, length: int) -> None: ...
\r
410 def __init__(self) -> None: ...
\r
411 def capitalize(self) -> bytearray: ...
\r
412 def center(self, width: int, fillchar: bytes = ...) -> bytearray: ...
\r
413 def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
414 def copy(self) -> bytearray: ...
\r
415 def decode(self, encoding: str = ..., errors: str = ...) -> str: ...
\r
416 def endswith(self, suffix: bytes) -> bool: ...
\r
417 def expandtabs(self, tabsize: int = ...) -> bytearray: ...
\r
418 def find(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
419 if sys.version_info >= (3, 5):
\r
420 def hex(self) -> str: ...
\r
421 def index(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
422 def insert(self, index: int, object: int) -> None: ...
\r
423 def isalnum(self) -> bool: ...
\r
424 def isalpha(self) -> bool: ...
\r
425 def isdigit(self) -> bool: ...
\r
426 def islower(self) -> bool: ...
\r
427 def isspace(self) -> bool: ...
\r
428 def istitle(self) -> bool: ...
\r
429 def isupper(self) -> bool: ...
\r
430 def join(self, iterable: Iterable[Union[ByteString, memoryview]]) -> bytearray: ...
\r
431 def ljust(self, width: int, fillchar: bytes = ...) -> bytearray: ...
\r
432 def lower(self) -> bytearray: ...
\r
433 def lstrip(self, chars: Optional[bytes] = ...) -> bytearray: ...
\r
434 def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
\r
435 def replace(self, old: bytes, new: bytes, count: int = ...) -> bytearray: ...
\r
436 def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
437 def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
\r
438 def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ...
\r
439 def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
\r
440 def rsplit(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ...
\r
441 def rstrip(self, chars: Optional[bytes] = ...) -> bytearray: ...
\r
442 def split(self, sep: Optional[bytes] = ..., maxsplit: int = ...) -> List[bytearray]: ...
\r
443 def splitlines(self, keepends: bool = ...) -> List[bytearray]: ...
\r
444 def startswith(self, prefix: bytes) -> bool: ...
\r
445 def strip(self, chars: Optional[bytes] = ...) -> bytearray: ...
\r
446 def swapcase(self) -> bytearray: ...
\r
447 def title(self) -> bytearray: ...
\r
448 def translate(self, table: Optional[bytes], delete: bytes = ...) -> bytearray: ...
\r
449 def upper(self) -> bytearray: ...
\r
450 def zfill(self, width: int) -> bytearray: ...
\r
452 def fromhex(cls, s: str) -> bytearray: ...
\r
454 def maketrans(cls, frm: bytes, to: bytes) -> bytes: ...
\r
456 def __len__(self) -> int: ...
\r
457 def __iter__(self) -> Iterator[int]: ...
\r
458 def __str__(self) -> str: ...
\r
459 def __repr__(self) -> str: ...
\r
460 def __int__(self) -> int: ...
\r
461 def __float__(self) -> float: ...
\r
462 def __hash__(self) -> int: ...
\r
464 def __getitem__(self, i: int) -> int: ...
\r
466 def __getitem__(self, s: slice) -> bytearray: ...
\r
468 def __setitem__(self, i: int, x: int) -> None: ...
\r
470 def __setitem__(self, s: slice, x: Union[Iterable[int], bytes]) -> None: ...
\r
471 def __delitem__(self, i: Union[int, slice]) -> None: ...
\r
472 def __add__(self, s: bytes) -> bytearray: ...
\r
473 def __iadd__(self, s: Iterable[int]) -> bytearray: ...
\r
474 def __mul__(self, n: int) -> bytearray: ...
\r
475 def __rmul__(self, n: int) -> bytearray: ...
\r
476 def __imul__(self, n: int) -> bytearray: ...
\r
477 if sys.version_info >= (3, 5):
\r
478 def __mod__(self, value: Any) -> bytes: ...
\r
479 def __contains__(self, o: object) -> bool: ...
\r
480 def __eq__(self, x: object) -> bool: ...
\r
481 def __ne__(self, x: object) -> bool: ...
\r
482 def __lt__(self, x: bytes) -> bool: ...
\r
483 def __le__(self, x: bytes) -> bool: ...
\r
484 def __gt__(self, x: bytes) -> bool: ...
\r
485 def __ge__(self, x: bytes) -> bool: ...
\r
487 class memoryview(Sized, Container[int]):
\r
488 format = ... # type: str
\r
489 itemsize = ... # type: int
\r
490 shape = ... # type: Optional[Tuple[int, ...]]
\r
491 strides = ... # type: Optional[Tuple[int, ...]]
\r
492 suboffsets = ... # type: Optional[Tuple[int, ...]]
\r
493 readonly = ... # type: bool
\r
494 ndim = ... # type: int
\r
496 def __init__(self, obj: Union[bytes, bytearray, memoryview]) -> None: ...
\r
499 def __getitem__(self, i: int) -> int: ...
\r
501 def __getitem__(self, s: slice) -> memoryview: ...
\r
503 def __contains__(self, x: object) -> bool: ...
\r
504 def __iter__(self) -> Iterator[int]: ...
\r
505 def __len__(self) -> int: ...
\r
508 def __setitem__(self, i: int, o: bytes) -> None: ...
\r
510 def __setitem__(self, s: slice, o: Sequence[bytes]) -> None: ...
\r
512 def __setitem__(self, s: slice, o: memoryview) -> None: ...
\r
514 def tobytes(self) -> bytes: ...
\r
515 def tolist(self) -> List[int]: ...
\r
517 if sys.version_info >= (3, 5):
\r
518 def hex(self) -> str: ...
\r
521 def __init__(self, o: object = ...) -> None: ...
\r
522 @overload # type: ignore
\r
523 def __and__(self, x: bool) -> bool: ...
\r
524 @overload # type: ignore
\r
525 def __and__(self, x: int) -> int: ...
\r
526 @overload # type: ignore
\r
527 def __or__(self, x: bool) -> bool: ...
\r
528 @overload # type: ignore
\r
529 def __or__(self, x: int) -> int: ...
\r
530 @overload # type: ignore
\r
531 def __xor__(self, x: bool) -> bool: ...
\r
532 @overload # type: ignore
\r
533 def __xor__(self, x: int) -> int: ...
\r
534 @overload # type: ignore
\r
535 def __rand__(self, x: bool) -> bool: ...
\r
536 @overload # type: ignore
\r
537 def __rand__(self, x: int) -> int: ...
\r
538 @overload # type: ignore
\r
539 def __ror__(self, x: bool) -> bool: ...
\r
540 @overload # type: ignore
\r
541 def __ror__(self, x: int) -> int: ...
\r
542 @overload # type: ignore
\r
543 def __rxor__(self, x: bool) -> bool: ...
\r
544 @overload # type: ignore
\r
545 def __rxor__(self, x: int) -> int: ...
\r
548 start = ... # type: Optional[int]
\r
549 step = ... # type: Optional[int]
\r
550 stop = ... # type: Optional[int]
\r
552 def __init__(self, stop: Optional[int]) -> None: ...
\r
554 def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = ...) -> None: ...
\r
555 def indices(self, len: int) -> Tuple[int, int, int]: ...
\r
557 class tuple(Sequence[_T_co], Generic[_T_co]):
\r
558 def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ...
\r
559 def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
\r
560 def __len__(self) -> int: ...
\r
561 def __contains__(self, x: object) -> bool: ...
\r
563 def __getitem__(self, x: int) -> _T_co: ...
\r
565 def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ...
\r
566 def __iter__(self) -> Iterator[_T_co]: ...
\r
567 def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ...
\r
568 def __le__(self, x: Tuple[_T_co, ...]) -> bool: ...
\r
569 def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ...
\r
570 def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ...
\r
571 def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ...
\r
572 def __mul__(self, n: int) -> Tuple[_T_co, ...]: ...
\r
573 def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ...
\r
574 def count(self, x: Any) -> int: ...
\r
575 if sys.version_info >= (3, 5):
\r
576 def index(self, x: Any, start: int = ..., end: int = ...) -> int: ...
\r
578 def index(self, x: Any) -> int: ...
\r
581 # TODO not defined in builtins!
\r
582 __name__ = ... # type: str
\r
583 __qualname__ = ... # type: str
\r
584 __module__ = ... # type: str
\r
585 __code__ = ... # type: CodeType
\r
586 __annotations__ = ... # type: Dict[str, Any]
\r
588 class list(MutableSequence[_T], Generic[_T]):
\r
590 def __init__(self) -> None: ...
\r
592 def __init__(self, iterable: Iterable[_T]) -> None: ...
\r
593 def clear(self) -> None: ...
\r
594 def copy(self) -> List[_T]: ...
\r
595 def append(self, object: _T) -> None: ...
\r
596 def extend(self, iterable: Iterable[_T]) -> None: ...
\r
597 def pop(self, index: int = ...) -> _T: ...
\r
598 def index(self, object: _T, start: int = ..., stop: int = ...) -> int: ...
\r
599 def count(self, object: _T) -> int: ...
\r
600 def insert(self, index: int, object: _T) -> None: ...
\r
601 def remove(self, object: _T) -> None: ...
\r
602 def reverse(self) -> None: ...
\r
603 def sort(self, *, key: Optional[Callable[[_T], Any]] = ..., reverse: bool = ...) -> None: ...
\r
605 def __len__(self) -> int: ...
\r
606 def __iter__(self) -> Iterator[_T]: ...
\r
607 def __str__(self) -> str: ...
\r
608 def __hash__(self) -> int: ...
\r
610 def __getitem__(self, i: int) -> _T: ...
\r
612 def __getitem__(self, s: slice) -> List[_T]: ...
\r
614 def __setitem__(self, i: int, o: _T) -> None: ...
\r
616 def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ...
\r
617 def __delitem__(self, i: Union[int, slice]) -> None: ...
\r
618 def __add__(self, x: List[_T]) -> List[_T]: ...
\r
619 def __iadd__(self, x: Iterable[_T]) -> List[_T]: ...
\r
620 def __mul__(self, n: int) -> List[_T]: ...
\r
621 def __rmul__(self, n: int) -> List[_T]: ...
\r
622 def __imul__(self, n: int) -> List[_T]: ...
\r
623 def __contains__(self, o: object) -> bool: ...
\r
624 def __reversed__(self) -> Iterator[_T]: ...
\r
625 def __gt__(self, x: List[_T]) -> bool: ...
\r
626 def __ge__(self, x: List[_T]) -> bool: ...
\r
627 def __lt__(self, x: List[_T]) -> bool: ...
\r
628 def __le__(self, x: List[_T]) -> bool: ...
\r
630 class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
\r
631 # NOTE: Keyword arguments are special. If they are used, _KT must include
\r
632 # str, but we have no way of enforcing it here.
\r
634 def __init__(self, **kwargs: _VT) -> None: ...
\r
636 def __init__(self, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
\r
638 def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
\r
640 def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
\r
642 def clear(self) -> None: ...
\r
643 def copy(self) -> Dict[_KT, _VT]: ...
\r
644 def popitem(self) -> Tuple[_KT, _VT]: ...
\r
645 def setdefault(self, k: _KT, default: Optional[_VT] = ...) -> _VT: ...
\r
647 def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
\r
649 def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
\r
651 def update(self, **kwargs: _VT) -> None: ...
\r
652 def keys(self) -> KeysView[_KT]: ...
\r
653 def values(self) -> ValuesView[_VT]: ...
\r
654 def items(self) -> ItemsView[_KT, _VT]: ...
\r
657 def fromkeys(seq: Iterable[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method (mypy/issues#328)
\r
660 def fromkeys(seq: Iterable[_T], value: _S) -> Dict[_T, _S]: ...
\r
661 def __len__(self) -> int: ...
\r
662 def __getitem__(self, k: _KT) -> _VT: ...
\r
663 def __setitem__(self, k: _KT, v: _VT) -> None: ...
\r
664 def __delitem__(self, v: _KT) -> None: ...
\r
665 def __iter__(self) -> Iterator[_KT]: ...
\r
666 def __str__(self) -> str: ...
\r
668 class set(MutableSet[_T], Generic[_T]):
\r
669 def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
\r
670 def add(self, element: _T) -> None: ...
\r
671 def clear(self) -> None: ...
\r
672 def copy(self) -> Set[_T]: ...
\r
673 def difference(self, *s: Iterable[object]) -> Set[_T]: ...
\r
674 def difference_update(self, *s: Iterable[object]) -> None: ...
\r
675 def discard(self, element: _T) -> None: ...
\r
676 def intersection(self, *s: Iterable[object]) -> Set[_T]: ...
\r
677 def intersection_update(self, *s: Iterable[Any]) -> None: ...
\r
678 def isdisjoint(self, s: Iterable[Any]) -> bool: ...
\r
679 def issubset(self, s: Iterable[Any]) -> bool: ...
\r
680 def issuperset(self, s: Iterable[Any]) -> bool: ...
\r
681 def pop(self) -> _T: ...
\r
682 def remove(self, element: _T) -> None: ...
\r
683 def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ...
\r
684 def symmetric_difference_update(self, s: Iterable[_T]) -> None: ...
\r
685 def union(self, *s: Iterable[_T]) -> Set[_T]: ...
\r
686 def update(self, *s: Iterable[_T]) -> None: ...
\r
687 def __len__(self) -> int: ...
\r
688 def __contains__(self, o: object) -> bool: ...
\r
689 def __iter__(self) -> Iterator[_T]: ...
\r
690 def __str__(self) -> str: ...
\r
691 def __and__(self, s: AbstractSet[object]) -> Set[_T]: ...
\r
692 def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ...
\r
693 def __or__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
\r
694 def __ior__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
\r
695 def __sub__(self, s: AbstractSet[object]) -> Set[_T]: ...
\r
696 def __isub__(self, s: AbstractSet[object]) -> Set[_T]: ...
\r
697 def __xor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
\r
698 def __ixor__(self, s: AbstractSet[_S]) -> Set[Union[_T, _S]]: ...
\r
699 def __le__(self, s: AbstractSet[object]) -> bool: ...
\r
700 def __lt__(self, s: AbstractSet[object]) -> bool: ...
\r
701 def __ge__(self, s: AbstractSet[object]) -> bool: ...
\r
702 def __gt__(self, s: AbstractSet[object]) -> bool: ...
\r
704 class frozenset(AbstractSet[_T], Generic[_T]):
\r
705 def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
\r
706 def copy(self) -> FrozenSet[_T]: ...
\r
707 def difference(self, *s: Iterable[object]) -> FrozenSet[_T]: ...
\r
708 def intersection(self, *s: Iterable[object]) -> FrozenSet[_T]: ...
\r
709 def isdisjoint(self, s: Iterable[_T]) -> bool: ...
\r
710 def issubset(self, s: Iterable[object]) -> bool: ...
\r
711 def issuperset(self, s: Iterable[object]) -> bool: ...
\r
712 def symmetric_difference(self, s: Iterable[_T]) -> FrozenSet[_T]: ...
\r
713 def union(self, *s: Iterable[_T]) -> FrozenSet[_T]: ...
\r
714 def __len__(self) -> int: ...
\r
715 def __contains__(self, o: object) -> bool: ...
\r
716 def __iter__(self) -> Iterator[_T]: ...
\r
717 def __str__(self) -> str: ...
\r
718 def __and__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ...
\r
719 def __or__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ...
\r
720 def __sub__(self, s: AbstractSet[_T]) -> FrozenSet[_T]: ...
\r
721 def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[Union[_T, _S]]: ...
\r
722 def __le__(self, s: AbstractSet[object]) -> bool: ...
\r
723 def __lt__(self, s: AbstractSet[object]) -> bool: ...
\r
724 def __ge__(self, s: AbstractSet[object]) -> bool: ...
\r
725 def __gt__(self, s: AbstractSet[object]) -> bool: ...
\r
727 class enumerate(Iterator[Tuple[int, _T]], Generic[_T]):
\r
728 def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ...
\r
729 def __iter__(self) -> Iterator[Tuple[int, _T]]: ...
\r
730 def __next__(self) -> Tuple[int, _T]: ...
\r
732 class range(Sequence[int]):
\r
733 start = ... # type: int
\r
734 stop = ... # type: int
\r
735 step = ... # type: int
\r
737 def __init__(self, stop: int) -> None: ...
\r
739 def __init__(self, start: int, stop: int, step: int = ...) -> None: ...
\r
740 def count(self, value: int) -> int: ...
\r
741 def index(self, value: int, start: int = ..., stop: Optional[int] = ...) -> int: ...
\r
742 def __len__(self) -> int: ...
\r
743 def __contains__(self, o: object) -> bool: ...
\r
744 def __iter__(self) -> Iterator[int]: ...
\r
746 def __getitem__(self, i: int) -> int: ...
\r
748 def __getitem__(self, s: slice) -> range: ...
\r
749 def __repr__(self) -> str: ...
\r
750 def __reversed__(self) -> Iterator[int]: ...
\r
753 def __init__(self, fget: Optional[Callable[[Any], Any]] = ...,
\r
754 fset: Optional[Callable[[Any, Any], None]] = ...,
\r
755 fdel: Optional[Callable[[Any], None]] = ...,
\r
756 doc: Optional[str] = ...) -> None: ...
\r
757 def getter(self, fget: Callable[[Any], Any]) -> property: ...
\r
758 def setter(self, fset: Callable[[Any, Any], None]) -> property: ...
\r
759 def deleter(self, fdel: Callable[[Any], None]) -> property: ...
\r
760 def __get__(self, obj: Any, type: Optional[type] = ...) -> Any: ...
\r
761 def __set__(self, obj: Any, value: Any) -> None: ...
\r
762 def __delete__(self, obj: Any) -> None: ...
\r
763 def fget(self) -> Any: ...
\r
764 def fset(self, value: Any) -> None: ...
\r
765 def fdel(self) -> None: ...
\r
767 NotImplemented = ... # type: Any
\r
769 def abs(n: SupportsAbs[_T]) -> _T: ...
\r
770 def all(i: Iterable[object]) -> bool: ...
\r
771 def any(i: Iterable[object]) -> bool: ...
\r
772 def ascii(o: object) -> str: ...
\r
773 def bin(number: int) -> str: ...
\r
774 if sys.version_info >= (3, 7):
\r
775 def breakpoint(*args: Any, **kws: Any) -> None: ...
\r
776 def callable(o: object) -> bool: ...
\r
777 def chr(code: int) -> str: ...
\r
778 if sys.version_info >= (3, 6):
\r
779 # This class is to be exported as PathLike from os,
\r
780 # but we define it here as _PathLike to avoid import cycle issues.
\r
781 # See https://github.com/python/typeshed/pull/991#issuecomment-288160993
\r
782 class _PathLike(Generic[AnyStr]):
\r
783 def __fspath__(self) -> AnyStr: ...
\r
784 def compile(source: Any, filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ...) -> CodeType: ...
\r
786 def compile(source: Any, filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ...) -> CodeType: ...
\r
787 def copyright() -> None: ...
\r
788 def credits() -> None: ...
\r
789 def delattr(o: Any, name: str) -> None: ...
\r
790 def dir(o: object = ...) -> List[str]: ...
\r
791 _N = TypeVar('_N', int, float)
\r
792 def divmod(a: _N, b: _N) -> Tuple[_N, _N]: ...
\r
793 def eval(source: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ...
\r
794 def exec(object: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ...
\r
795 def exit(code: Any = ...) -> NoReturn: ...
\r
797 def filter(function: None, iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ...
\r
799 def filter(function: Callable[[_T], Any], iterable: Iterable[_T]) -> Iterator[_T]: ...
\r
800 def format(o: object, format_spec: str = ...) -> str: ...
\r
801 def getattr(o: Any, name: str, default: Any = ...) -> Any: ...
\r
802 def globals() -> Dict[str, Any]: ...
\r
803 def hasattr(o: Any, name: str) -> bool: ...
\r
804 def hash(o: object) -> int: ...
\r
805 def help(*args: Any, **kwds: Any) -> None: ...
\r
806 def hex(i: int) -> str: ... # TODO __index__
\r
807 def id(o: object) -> int: ...
\r
808 def input(prompt: Optional[Any] = ...) -> str: ...
\r
810 def iter(iterable: Iterable[_T]) -> Iterator[_T]: ...
\r
812 def iter(function: Callable[[], _T], sentinel: _T) -> Iterator[_T]: ...
\r
813 def isinstance(o: object, t: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ...
\r
814 def issubclass(cls: type, classinfo: Union[type, Tuple[Union[type, Tuple], ...]]) -> bool: ...
\r
815 def len(o: Sized) -> int: ...
\r
816 def license() -> None: ...
\r
817 def locals() -> Dict[str, Any]: ...
\r
819 def map(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ...
\r
821 def map(func: Callable[[_T1, _T2], _S], iter1: Iterable[_T1],
\r
822 iter2: Iterable[_T2]) -> Iterator[_S]: ...
\r
824 def map(func: Callable[[_T1, _T2, _T3], _S],
\r
825 iter1: Iterable[_T1],
\r
826 iter2: Iterable[_T2],
\r
827 iter3: Iterable[_T3]) -> Iterator[_S]: ...
\r
829 def map(func: Callable[[_T1, _T2, _T3, _T4], _S],
\r
830 iter1: Iterable[_T1],
\r
831 iter2: Iterable[_T2],
\r
832 iter3: Iterable[_T3],
\r
833 iter4: Iterable[_T4]) -> Iterator[_S]: ...
\r
835 def map(func: Callable[[_T1, _T2, _T3, _T4, _T5], _S],
\r
836 iter1: Iterable[_T1],
\r
837 iter2: Iterable[_T2],
\r
838 iter3: Iterable[_T3],
\r
839 iter4: Iterable[_T4],
\r
840 iter5: Iterable[_T5]) -> Iterator[_S]: ...
\r
842 def map(func: Callable[..., _S],
\r
843 iter1: Iterable[Any],
\r
844 iter2: Iterable[Any],
\r
845 iter3: Iterable[Any],
\r
846 iter4: Iterable[Any],
\r
847 iter5: Iterable[Any],
\r
848 iter6: Iterable[Any],
\r
849 *iterables: Iterable[Any]) -> Iterator[_S]: ...
\r
851 def max(arg1: _T, arg2: _T, *args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
\r
853 def max(iterable: Iterable[_T], key: Callable[[_T], Any] = ..., default: _T = ...) -> _T: ...
\r
855 def min(arg1: _T, arg2: _T, *args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
\r
857 def min(iterable: Iterable[_T], key: Callable[[_T], Any] = ..., default: _T = ...) -> _T: ...
\r
859 def next(i: Iterator[_T]) -> _T: ...
\r
861 def next(i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ...
\r
862 def oct(i: int) -> str: ... # TODO __index__
\r
864 if sys.version_info >= (3, 6):
\r
865 def open(file: Union[str, bytes, int, _PathLike], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
\r
866 errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
\r
868 def open(file: Union[str, bytes, int], mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
\r
869 errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ...) -> IO[Any]: ...
\r
871 def ord(c: Union[str, bytes, bytearray]) -> int: ...
\r
872 def print(*values: Any, sep: str = ..., end: str = ..., file: Optional[IO[str]] = ..., flush: bool = ...) -> None: ...
\r
874 def pow(x: int, y: int) -> Any: ... # The return type can be int or float, depending on y
\r
876 def pow(x: int, y: int, z: int) -> Any: ...
\r
878 def pow(x: float, y: float) -> float: ...
\r
880 def pow(x: float, y: float, z: float) -> float: ...
\r
881 def quit(code: Optional[int] = ...) -> None: ...
\r
883 def reversed(object: Sequence[_T]) -> Iterator[_T]: ...
\r
885 def reversed(object: Reversible[_T]) -> Iterator[_T]: ...
\r
886 def repr(o: object) -> str: ...
\r
888 def round(number: float) -> int: ...
\r
890 def round(number: float, ndigits: None) -> int: ...
\r
892 def round(number: float, ndigits: int) -> float: ...
\r
894 def round(number: SupportsRound[_T]) -> int: ...
\r
896 def round(number: SupportsRound[_T], ndigits: None) -> int: ... # type: ignore
\r
898 def round(number: SupportsRound[_T], ndigits: int) -> _T: ...
\r
899 def setattr(object: Any, name: str, value: Any) -> None: ...
\r
900 def sorted(iterable: Iterable[_T], *,
\r
901 key: Optional[Callable[[_T], Any]] = ...,
\r
902 reverse: bool = ...) -> List[_T]: ...
\r
904 def sum(iterable: Iterable[_T]) -> Union[_T, int]: ...
\r
906 def sum(iterable: Iterable[_T], start: _S) -> Union[_T, _S]: ...
\r
907 def vars(object: Any = ...) -> Dict[str, Any]: ...
\r
909 def zip(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ...
\r
911 def zip(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ...
\r
913 def zip(iter1: Iterable[_T1], iter2: Iterable[_T2],
\r
914 iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ...
\r
916 def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
\r
917 iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2,
\r
920 def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
\r
921 iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2,
\r
922 _T3, _T4, _T5]]: ...
\r
924 def zip(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any],
\r
925 iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any],
\r
926 *iterables: Iterable[Any]) -> Iterator[Tuple[Any, ...]]: ...
\r
927 def __import__(name: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...,
\r
928 fromlist: List[str] = ..., level: int = ...) -> Any: ...
\r
932 # Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
\r
933 # not exposed anywhere under that name, we make it private here.
\r
934 class ellipsis: ...
\r
935 Ellipsis = ... # type: ellipsis
\r
939 class BaseException:
\r
940 args = ... # type: Tuple[Any, ...]
\r
941 __cause__ = ... # type: Optional[BaseException]
\r
942 __context__ = ... # type: Optional[BaseException]
\r
943 __traceback__ = ... # type: Optional[TracebackType]
\r
944 def __init__(self, *args: object, **kwargs: object) -> None: ...
\r
945 def with_traceback(self, tb: Optional[TracebackType]) -> BaseException: ...
\r
947 class GeneratorExit(BaseException): ...
\r
948 class KeyboardInterrupt(BaseException): ...
\r
949 class SystemExit(BaseException):
\r
951 class Exception(BaseException): ...
\r
952 class ArithmeticError(Exception): ...
\r
953 class OSError(Exception):
\r
955 strerror = ... # type: str
\r
956 # filename, filename2 are actually Union[str, bytes, None]
\r
957 filename = ... # type: Any
\r
958 filename2 = ... # type: Any
\r
960 EnvironmentError = OSError
\r
961 class WindowsError(OSError):
\r
962 winerror = ... # type: int
\r
963 class LookupError(Exception): ...
\r
964 class RuntimeError(Exception): ...
\r
965 class ValueError(Exception): ...
\r
966 class AssertionError(Exception): ...
\r
967 class AttributeError(Exception): ...
\r
968 class BufferError(Exception): ...
\r
969 class EOFError(Exception): ...
\r
970 class FloatingPointError(ArithmeticError): ...
\r
971 class ImportError(Exception):
\r
972 name = ... # type: str
\r
973 path = ... # type: str
\r
974 if sys.version_info >= (3, 6):
\r
975 class ModuleNotFoundError(ImportError): ...
\r
976 class IndexError(LookupError): ...
\r
977 class KeyError(LookupError): ...
\r
978 class MemoryError(Exception): ...
\r
979 class NameError(Exception): ...
\r
980 class NotImplementedError(RuntimeError): ...
\r
981 class BlockingIOError(OSError):
\r
982 characters_written = 0
\r
983 class ChildProcessError(OSError): ...
\r
984 class ConnectionError(OSError): ...
\r
985 class BrokenPipeError(ConnectionError): ...
\r
986 class ConnectionAbortedError(ConnectionError): ...
\r
987 class ConnectionRefusedError(ConnectionError): ...
\r
988 class ConnectionResetError(ConnectionError): ...
\r
989 class FileExistsError(OSError): ...
\r
990 class FileNotFoundError(OSError): ...
\r
991 class InterruptedError(OSError): ...
\r
992 class IsADirectoryError(OSError): ...
\r
993 class NotADirectoryError(OSError): ...
\r
994 class PermissionError(OSError): ...
\r
995 class ProcessLookupError(OSError): ...
\r
996 class TimeoutError(OSError): ...
\r
997 class OverflowError(ArithmeticError): ...
\r
998 class ReferenceError(Exception): ...
\r
999 class StopIteration(Exception):
\r
1000 value = ... # type: Any
\r
1001 if sys.version_info >= (3, 5):
\r
1002 class StopAsyncIteration(Exception):
\r
1003 value = ... # type: Any
\r
1004 class RecursionError(RuntimeError): ...
\r
1005 class SyntaxError(Exception):
\r
1006 msg = ... # type: str
\r
1007 lineno = ... # type: int
\r
1008 offset = ... # type: int
\r
1009 text = ... # type: str
\r
1010 filename = ... # type: str
\r
1011 class IndentationError(SyntaxError): ...
\r
1012 class TabError(IndentationError): ...
\r
1013 class SystemError(Exception): ...
\r
1014 class TypeError(Exception): ...
\r
1015 class UnboundLocalError(NameError): ...
\r
1016 class UnicodeError(ValueError): ...
\r
1017 class UnicodeDecodeError(UnicodeError):
\r
1018 encoding = ... # type: str
\r
1019 object = ... # type: bytes
\r
1020 start = ... # type: int
\r
1021 end = ... # type: int
\r
1022 reason = ... # type: str
\r
1023 def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int,
\r
1024 __reason: str) -> None: ...
\r
1025 class UnicodeEncodeError(UnicodeError):
\r
1026 encoding = ... # type: str
\r
1027 object = ... # type: str
\r
1028 start = ... # type: int
\r
1029 end = ... # type: int
\r
1030 reason = ... # type: str
\r
1031 def __init__(self, __encoding: str, __object: str, __start: int, __end: int,
\r
1032 __reason: str) -> None: ...
\r
1033 class UnicodeTranslateError(UnicodeError): ...
\r
1034 class ZeroDivisionError(ArithmeticError): ...
\r
1036 class Warning(Exception): ...
\r
1037 class UserWarning(Warning): ...
\r
1038 class DeprecationWarning(Warning): ...
\r
1039 class SyntaxWarning(Warning): ...
\r
1040 class RuntimeWarning(Warning): ...
\r
1041 class FutureWarning(Warning): ...
\r
1042 class PendingDeprecationWarning(Warning): ...
\r
1043 class ImportWarning(Warning): ...
\r
1044 class UnicodeWarning(Warning): ...
\r
1045 class BytesWarning(Warning): ...
\r
1046 class ResourceWarning(Warning): ...
\r