| 1 |
import _typeshed |
| 2 |
from typing import Sequence, Iterator, TypeVar, Mapping, Iterable, Optional, Union, overload, Tuple, Generic, List |
| 3 |
|
| 4 |
class object: |
| 5 |
def __init__(self) -> None: ... |
| 6 |
def __init_subclass__(cls) -> None: ... |
| 7 |
|
| 8 |
T = TypeVar('T') |
| 9 |
KT = TypeVar('KT') |
| 10 |
VT = TypeVar('VT') |
| 11 |
# copy pasted from primitives.pyi |
| 12 |
class type: |
| 13 |
def __init__(self, x) -> None: pass |
| 14 |
|
| 15 |
class int: |
| 16 |
# Note: this is a simplification of the actual signature |
| 17 |
def __init__(self, x: object = ..., base: int = ...) -> None: pass |
| 18 |
def __add__(self, i: int) -> int: pass |
| 19 |
class float: |
| 20 |
def __float__(self) -> float: pass |
| 21 |
class complex: pass |
| 22 |
class bool(int): pass |
| 23 |
class str(Sequence[str]): |
| 24 |
def __add__(self, s: str) -> str: pass |
| 25 |
def __iter__(self) -> Iterator[str]: pass |
| 26 |
def __contains__(self, other: object) -> bool: pass |
| 27 |
def __getitem__(self, item: int) -> str: pass |
| 28 |
def format(self, *args) -> str: pass |
| 29 |
class bytes(Sequence[int]): |
| 30 |
def __iter__(self) -> Iterator[int]: pass |
| 31 |
def __contains__(self, other: object) -> bool: pass |
| 32 |
def __getitem__(self, item: int) -> int: pass |
| 33 |
class bytearray: pass |
| 34 |
class tuple(Generic[T]): pass |
| 35 |
class function: pass |
| 36 |
class ellipsis: pass |
| 37 |
|
| 38 |
# copy-pasted from list.pyi |
| 39 |
class list(Sequence[T]): |
| 40 |
def __iter__(self) -> Iterator[T]: pass |
| 41 |
def __mul__(self, x: int) -> list[T]: pass |
| 42 |
def __setitem__(self, x: int, v: T) -> None: pass |
| 43 |
def __getitem__(self, x: int) -> T: pass |
| 44 |
def __add__(self, x: List[T]) -> T: pass |
| 45 |
def __contains__(self, item: object) -> bool: pass |
| 46 |
|
| 47 |
# copy-pasted from dict.pyi |
| 48 |
class dict(Mapping[KT, VT]): |
| 49 |
@overload |
| 50 |
def __init__(self, **kwargs: VT) -> None: pass |
| 51 |
@overload |
| 52 |
def __init__(self, arg: Iterable[Tuple[KT, VT]], **kwargs: VT) -> None: pass |
| 53 |
def __getitem__(self, key: KT) -> VT: pass |
| 54 |
def __setitem__(self, k: KT, v: VT) -> None: pass |
| 55 |
def __iter__(self) -> Iterator[KT]: pass |
| 56 |
def __contains__(self, item: object) -> int: pass |
| 57 |
def update(self, a: Mapping[KT, VT]) -> None: pass |
| 58 |
@overload |
| 59 |
def get(self, key: KT, default: None = None, /) -> Optional[VT]: pass |
| 60 |
@overload |
| 61 |
def get(self, key: KT, default: VT, /) -> VT: pass |
| 62 |
@overload |
| 63 |
def get(self, key: KT, default: T, /) -> Union[VT, T]: pass |
| 64 |
def __len__(self) -> int: ... |