| 1 |
# Builtins stub used in some tuple-related test cases. |
| 2 |
# |
| 3 |
# This is a simpler version of tuple.py which is useful |
| 4 |
# and makes some test cases easier to write/debug. |
| 5 |
|
| 6 |
from typing import Iterable, TypeVar, Generic |
| 7 |
|
| 8 |
T = TypeVar('T', covariant=True) |
| 9 |
|
| 10 |
class object: |
| 11 |
def __init__(self): pass |
| 12 |
|
| 13 |
class type: pass |
| 14 |
class tuple(Generic[T]): |
| 15 |
def __getitem__(self, x: int) -> T: pass |
| 16 |
class function: pass |
| 17 |
|
| 18 |
# We need int for indexing tuples. |
| 19 |
class int: pass |
| 20 |
class str: pass # For convenience |
| 21 |
class dict: pass |