-
Notifications
You must be signed in to change notification settings - Fork 23
/
typing.py
158 lines (101 loc) · 2.1 KB
/
typing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
def cast(type, val):
return val
def get_origin(type):
return None
def get_args(type):
return ()
def no_type_check(func):
def wrapper(*args, **kwargs):
func(*args, **kwargs)
return wrapper
def overload(func):
return None
class _AnyCall:
def __init__(*args, **kwargs):
pass
def __call__(*args, **kwargs):
pass
def __getitem__(self, arg):
return _anyCall
_anyCall = _AnyCall()
class _SubscriptableType:
def __getitem__(self, arg):
return _anyCall
_Subscriptable = _SubscriptableType()
def TypeVar(type, *types):
return None
def NewType(name, type):
return type
class Any:
pass
class BinaryIO:
pass
class ClassVar:
pass
class Final:
pass
class Hashable:
pass
class IO:
pass
class NoReturn:
pass
class Sized:
pass
class SupportsInt:
pass
class SupportsFloat:
pass
class SupportsComplex:
pass
class SupportsBytes:
pass
class SupportsIndex:
pass
class SupportsAbs:
pass
class SupportsRound:
pass
class TextIO:
pass
AnyStr = str
Text = str
Pattern = str
Match = str
TypedDict = dict
AbstractSet = _Subscriptable
AsyncContextManager = _Subscriptable
AsyncGenerator = _Subscriptable
AsyncIterable = _Subscriptable
AsyncIterator = _Subscriptable
Awaitable = _Subscriptable
Callable = _Subscriptable
ChainMap = _Subscriptable
Collection = _Subscriptable
Container = _Subscriptable
ContextManager = _Subscriptable
Coroutine = _Subscriptable
Counter = _Subscriptable
DefaultDict = _Subscriptable
Deque = _Subscriptable
Dict = _Subscriptable
FrozenSet = _Subscriptable
Generator = _Subscriptable
Generic = _Subscriptable
Iterable = _Subscriptable
Iterator = _Subscriptable
List = _Subscriptable
Literal = _Subscriptable
Mapping = _Subscriptable
MutableMapping = _Subscriptable
MutableSequence = _Subscriptable
MutableSet = _Subscriptable
NamedTuple = _Subscriptable
Optional = _Subscriptable
OrderedDict = _Subscriptable
Sequence = _Subscriptable
Set = _Subscriptable
Tuple = _Subscriptable
Type = _Subscriptable
Union = _Subscriptable
TYPE_CHECKING = False