2 # Note, all classes "defined" here require special handling.
\r
5 Any, Callable, Dict, Iterable, Iterator, List, Optional,
\r
6 Tuple, Type, TypeVar, Union, overload,
\r
16 LongType = int # Really long, but can't reference that due to a mypy import cycle
\r
19 ComplexType = complex
\r
21 UnicodeType = unicode
\r
22 StringTypes = ... # type: Tuple[Type[StringType], Type[UnicodeType]]
\r
27 DictionaryType = dict
\r
30 cell_contents = ... # type: Any
\r
33 func_closure = ... # type: Optional[Tuple[_Cell, ...]]
\r
34 func_code = ... # type: CodeType
\r
35 func_defaults = ... # type: Optional[Tuple[Any, ...]]
\r
36 func_dict = ... # type: Dict[str, Any]
\r
37 func_doc = ... # type: Optional[str]
\r
38 func_globals = ... # type: Dict[str, Any]
\r
39 func_name = ... # type: str
\r
40 __closure__ = func_closure
\r
41 __code__ = func_code
\r
42 __defaults__ = func_defaults
\r
43 __dict__ = func_dict
\r
44 __globals__ = func_globals
\r
45 __name__ = func_name
\r
46 def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
\r
47 def __get__(self, obj: Optional[object], type: Optional[type]) -> 'UnboundMethodType': ...
\r
49 LambdaType = FunctionType
\r
52 co_argcount = ... # type: int
\r
53 co_cellvars = ... # type: Tuple[str, ...]
\r
54 co_code = ... # type: str
\r
55 co_consts = ... # type: Tuple[Any, ...]
\r
56 co_filename = ... # type: Optional[str]
\r
57 co_firstlineno = ... # type: int
\r
58 co_flags = ... # type: int
\r
59 co_freevars = ... # type: Tuple[str, ...]
\r
60 co_lnotab = ... # type: str
\r
61 co_name = ... # type: str
\r
62 co_names = ... # type: Tuple[str, ...]
\r
63 co_nlocals = ... # type: int
\r
64 co_stacksize = ... # type: int
\r
65 co_varnames = ... # type: Tuple[str, ...]
\r
67 class GeneratorType:
\r
68 gi_code = ... # type: CodeType
\r
69 gi_frame = ... # type: FrameType
\r
70 gi_running = ... # type: int
\r
71 def __iter__(self) -> 'GeneratorType': ...
\r
72 def close(self) -> None: ...
\r
73 def next(self) -> Any: ...
\r
74 def send(self, arg: Any) -> Any: ...
\r
76 def throw(self, val: BaseException) -> Any: ...
\r
78 def throw(self, typ: type, val: BaseException = ..., tb: 'TracebackType' = ...) -> Any: ...
\r
80 class ClassType: ...
\r
81 class UnboundMethodType:
\r
82 im_class = ... # type: type
\r
83 im_func = ... # type: FunctionType
\r
84 im_self = ... # type: object
\r
85 __name__ = ... # type: str
\r
88 def __init__(self, func: Callable, obj: object) -> None: ...
\r
89 def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
\r
92 __doc__ = ... # type: Optional[str]
\r
93 __class__ = ... # type: type
\r
94 __module__ = ... # type: Any
\r
96 MethodType = UnboundMethodType
\r
98 class BuiltinFunctionType:
\r
99 __self__ = ... # type: Optional[object]
\r
100 def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
\r
101 BuiltinMethodType = BuiltinFunctionType
\r
104 __doc__ = ... # type: Optional[str]
\r
105 __file__ = ... # type: Optional[str]
\r
106 __name__ = ... # type: str
\r
107 __package__ = ... # type: Optional[str]
\r
108 __path__ = ... # type: Optional[Iterable[str]]
\r
109 __dict__ = ... # type: Dict[str, Any]
\r
110 def __init__(self, name: str, doc: Optional[str] = ...) -> None: ...
\r
112 XRangeType = xrange
\r
114 class TracebackType:
\r
115 tb_frame = ... # type: FrameType
\r
116 tb_lasti = ... # type: int
\r
117 tb_lineno = ... # type: int
\r
118 tb_next = ... # type: TracebackType
\r
121 f_back = ... # type: FrameType
\r
122 f_builtins = ... # type: Dict[str, Any]
\r
123 f_code = ... # type: CodeType
\r
124 f_exc_type = ... # type: None
\r
125 f_exc_value = ... # type: None
\r
126 f_exc_traceback = ... # type: None
\r
127 f_globals = ... # type: Dict[str, Any]
\r
128 f_lasti = ... # type: int
\r
129 f_lineno = ... # type: int
\r
130 f_locals = ... # type: Dict[str, Any]
\r
131 f_restricted = ... # type: bool
\r
132 f_trace = ... # type: Callable[[], None]
\r
134 def clear(self) -> None: ...
\r
137 class EllipsisType: ...
\r
139 class DictProxyType:
\r
140 # TODO is it possible to have non-string keys?
\r
142 def copy(self) -> dict: ...
\r
143 def get(self, key: str, default: _T = ...) -> Union[Any, _T]: ...
\r
144 def has_key(self, key: str) -> bool: ...
\r
145 def items(self) -> List[Tuple[str, Any]]: ...
\r
146 def iteritems(self) -> Iterator[Tuple[str, Any]]: ...
\r
147 def iterkeys(self) -> Iterator[str]: ...
\r
148 def itervalues(self) -> Iterator[Any]: ...
\r
149 def keys(self) -> List[str]: ...
\r
150 def values(self) -> List[Any]: ...
\r
151 def __contains__(self, key: str) -> bool: ...
\r
152 def __getitem__(self, key: str) -> Any: ...
\r
153 def __iter__(self) -> Iterator[str]: ...
\r
154 def __len__(self) -> int: ...
\r
156 class NotImplementedType: ...
\r
158 class GetSetDescriptorType:
\r
159 __name__ = ... # type: str
\r
160 __objclass__ = ... # type: type
\r
161 def __get__(self, obj: Any, type: type = ...) -> Any: ...
\r
162 def __set__(self, obj: Any) -> None: ...
\r
163 def __delete__(self, obj: Any) -> None: ...
\r
164 # Same type on Jython, different on CPython and PyPy, unknown on IronPython.
\r
165 class MemberDescriptorType:
\r
166 __name__ = ... # type: str
\r
167 __objclass__ = ... # type: type
\r
168 def __get__(self, obj: Any, type: type = ...) -> Any: ...
\r
169 def __set__(self, obj: Any) -> None: ...
\r
170 def __delete__(self, obj: Any) -> None: ...
\r