|
| 1 | +from typing import builtinclass, Iterable, Iterator, Generic, TypeVar, List, Mapping, overload, Tuple, Set, Union |
| 2 | + |
| 3 | +@builtinclass |
| 4 | +class object: |
| 5 | + def __init__(self) -> None: pass |
| 6 | + |
| 7 | +@builtinclass |
| 8 | +class type: |
| 9 | + def __init__(self, x) -> None: pass |
| 10 | + |
| 11 | +class tuple: pass |
| 12 | +class function: pass |
| 13 | + |
| 14 | +def isinstance(x: object, t: Union[type, Tuple]) -> bool: pass |
| 15 | + |
| 16 | +@builtinclass |
| 17 | +class int: |
| 18 | + def __add__(self, x: int) -> int: pass |
| 19 | +@builtinclass |
| 20 | +class bool(int): pass |
| 21 | +@builtinclass |
| 22 | +class str: |
| 23 | + def __add__(self, x: str) -> str: pass |
| 24 | + def __getitem__(self, x: int) -> str: pass |
| 25 | + |
| 26 | +T = TypeVar('T') |
| 27 | +KT = TypeVar('KT') |
| 28 | +VT = TypeVar('VT') |
| 29 | + |
| 30 | +class list(Iterable[T], Generic[T]): |
| 31 | + def __iter__(self) -> Iterator[T]: pass |
| 32 | + def __mul__(self, x: int) -> list[T]: pass |
| 33 | + def __setitem__(self, x: int, v: T) -> None: pass |
| 34 | + def __getitem__(self, x: int) -> T: pass |
| 35 | + def __add__(self, x: List[T]) -> T: pass |
| 36 | + |
| 37 | +class dict(Iterable[KT], Mapping[KT, VT], Generic[KT, VT]): |
| 38 | + @overload |
| 39 | + def __init__(self, **kwargs: VT) -> None: pass |
| 40 | + @overload |
| 41 | + def __init__(self, arg: Iterable[Tuple[KT, VT]], **kwargs: VT) -> None: pass |
| 42 | + def __setitem__(self, k: KT, v: VT) -> None: pass |
| 43 | + def __iter__(self) -> Iterator[KT]: pass |
| 44 | + def update(self, a: Mapping[KT, VT]) -> None: pass |
| 45 | + |
| 46 | +class set(Iterable[T], Generic[T]): |
| 47 | + def __iter__(self) -> Iterator[T]: pass |
| 48 | + def add(self, x: T) -> None: pass |
| 49 | + def discard(self, x: T) -> None: pass |
| 50 | + def update(self, x: Set[T]) -> None: pass |
0 commit comments