| 1 |
# Builtins stub used in list-related test cases. |
| 2 |
|
| 3 |
from typing import TypeVar, Generic, Iterable, Iterator, Sequence, overload |
| 4 |
|
| 5 |
T = TypeVar('T') |
| 6 |
|
| 7 |
class object: |
| 8 |
def __init__(self) -> None: pass |
| 9 |
def __eq__(self, other: object) -> bool: pass |
| 10 |
|
| 11 |
class type: pass |
| 12 |
class ellipsis: pass |
| 13 |
|
| 14 |
class list(Sequence[T]): |
| 15 |
@overload |
| 16 |
def __init__(self) -> None: pass |
| 17 |
@overload |
| 18 |
def __init__(self, x: Iterable[T]) -> None: pass |
| 19 |
def __iter__(self) -> Iterator[T]: pass |
| 20 |
def __len__(self) -> int: pass |
| 21 |
def __contains__(self, item: object) -> bool: pass |
| 22 |
def __add__(self, x: list[T]) -> list[T]: pass |
| 23 |
def __mul__(self, x: int) -> list[T]: pass |
| 24 |
def __getitem__(self, x: int) -> T: pass |
| 25 |
def __setitem__(self, x: int, v: T) -> None: pass |
| 26 |
def append(self, x: T) -> None: pass |
| 27 |
def extend(self, x: Iterable[T]) -> None: pass |
| 28 |
|
| 29 |
class tuple(Generic[T]): pass |
| 30 |
class function: pass |
| 31 |
class int: |
| 32 |
def __bool__(self) -> bool: pass |
| 33 |
class float: |
| 34 |
def __bool__(self) -> bool: pass |
| 35 |
class str: |
| 36 |
def __len__(self) -> bool: pass |
| 37 |
class bool(int): pass |
| 38 |
|
| 39 |
property = object() # Dummy definition. |
| 40 |
|
| 41 |
class dict: pass |