| 1 |
# builtins stub with non-generic primitive types |
| 2 |
import _typeshed |
| 3 |
from typing import Generic, TypeVar, Sequence, Iterator, Mapping, Iterable, Tuple, Union |
| 4 |
|
| 5 |
T = TypeVar('T') |
| 6 |
V = TypeVar('V') |
| 7 |
|
| 8 |
class object: |
| 9 |
def __init__(self) -> None: pass |
| 10 |
def __str__(self) -> str: pass |
| 11 |
def __eq__(self, other: object) -> bool: pass |
| 12 |
def __ne__(self, other: object) -> bool: pass |
| 13 |
|
| 14 |
class type: |
| 15 |
def __init__(self, x: object) -> None: pass |
| 16 |
# Real implementation returns UnionType |
| 17 |
def __or__(self, value: object, /) -> object: pass |
| 18 |
|
| 19 |
class int: |
| 20 |
# Note: this is a simplification of the actual signature |
| 21 |
def __init__(self, x: object = ..., base: int = ...) -> None: pass |
| 22 |
def __add__(self, i: int) -> int: pass |
| 23 |
def __rmul__(self, x: int) -> int: pass |
| 24 |
def __bool__(self) -> bool: pass |
| 25 |
class float: |
| 26 |
def __float__(self) -> float: pass |
| 27 |
def __add__(self, x: float) -> float: pass |
| 28 |
def hex(self) -> str: pass |
| 29 |
class complex: |
| 30 |
def __add__(self, x: complex) -> complex: pass |
| 31 |
class bool(int): pass |
| 32 |
class str(Sequence[str]): |
| 33 |
def __add__(self, s: str) -> str: pass |
| 34 |
def __iter__(self) -> Iterator[str]: pass |
| 35 |
def __contains__(self, other: object) -> bool: pass |
| 36 |
def __getitem__(self, item: int) -> str: pass |
| 37 |
def format(self, *args: object, **kwargs: object) -> str: pass |
| 38 |
def join(self, iterable: Iterable[str], /) -> str: pass |
| 39 |
def split(self, sep: str = ...) -> list[str]: pass |
| 40 |
class bytes(Sequence[int]): |
| 41 |
def __iter__(self) -> Iterator[int]: pass |
| 42 |
def __contains__(self, other: object) -> bool: pass |
| 43 |
def __getitem__(self, item: int) -> int: pass |
| 44 |
def __eq__(self, other: object) -> bool: pass |
| 45 |
class bytearray(Sequence[int]): |
| 46 |
def __init__(self, x: bytes) -> None: pass |
| 47 |
def __iter__(self) -> Iterator[int]: pass |
| 48 |
def __contains__(self, other: object) -> bool: pass |
| 49 |
def __getitem__(self, item: int) -> int: pass |
| 50 |
def __eq__(self, other: object) -> bool: pass |
| 51 |
class memoryview(Sequence[int]): |
| 52 |
def __init__(self, x: bytes) -> None: pass |
| 53 |
def __iter__(self) -> Iterator[int]: pass |
| 54 |
def __contains__(self, other: object) -> bool: pass |
| 55 |
def __getitem__(self, item: int) -> int: pass |
| 56 |
def __eq__(self, other: object) -> bool: pass |
| 57 |
class tuple(Generic[T]): |
| 58 |
def __contains__(self, other: object) -> bool: pass |
| 59 |
class list(Sequence[T]): |
| 60 |
def append(self, v: T) -> None: pass |
| 61 |
def __iter__(self) -> Iterator[T]: pass |
| 62 |
def __contains__(self, other: object) -> bool: pass |
| 63 |
def __getitem__(self, item: int) -> T: pass |
| 64 |
class dict(Mapping[T, V]): |
| 65 |
def __iter__(self) -> Iterator[T]: pass |
| 66 |
class set(Iterable[T]): |
| 67 |
def __iter__(self) -> Iterator[T]: pass |
| 68 |
def __contains__(self, o: object, /) -> bool: pass |
| 69 |
class frozenset(Iterable[T]): |
| 70 |
def __iter__(self) -> Iterator[T]: pass |
| 71 |
class function: pass |
| 72 |
class ellipsis: pass |
| 73 |
|
| 74 |
class range(Sequence[int]): |
| 75 |
def __init__(self, __x: int, __y: int = ..., __z: int = ...) -> None: pass |
| 76 |
def count(self, value: int) -> int: pass |
| 77 |
def index(self, value: int) -> int: pass |
| 78 |
def __getitem__(self, i: int) -> int: pass |
| 79 |
def __iter__(self) -> Iterator[int]: pass |
| 80 |
def __contains__(self, other: object) -> bool: pass |
| 81 |
|
| 82 |
def isinstance(x: object, t: Union[type, Tuple]) -> bool: pass |
| 83 |
|
| 84 |
class BaseException: pass |
| 85 |
|
| 86 |
class slice: pass |