massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2 / types.pyi
1 # Stubs for types\r
2 # Note, all classes "defined" here require special handling.\r
3 \r
4 from typing import (\r
5     Any, Callable, Dict, Iterable, Iterator, List, Optional,\r
6     Tuple, Type, TypeVar, Union, overload,\r
7 )\r
8 \r
9 _T = TypeVar('_T')\r
10 \r
11 class NoneType: ...\r
12 TypeType = type\r
13 ObjectType = object\r
14 \r
15 IntType = int\r
16 LongType = int  # Really long, but can't reference that due to a mypy import cycle\r
17 FloatType = float\r
18 BooleanType = bool\r
19 ComplexType = complex\r
20 StringType = str\r
21 UnicodeType = unicode\r
22 StringTypes = ...  # type: Tuple[Type[StringType], Type[UnicodeType]]\r
23 BufferType = buffer\r
24 TupleType = tuple\r
25 ListType = list\r
26 DictType = dict\r
27 DictionaryType = dict\r
28 \r
29 class _Cell:\r
30     cell_contents = ...  # type: Any\r
31 \r
32 class FunctionType:\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
48 \r
49 LambdaType = FunctionType\r
50 \r
51 class CodeType:\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
66 \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
75     @overload\r
76     def throw(self, val: BaseException) -> Any: ...\r
77     @overload\r
78     def throw(self, typ: type, val: BaseException = ..., tb: 'TracebackType' = ...) -> Any: ...\r
79 \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
86     __func__ = im_func\r
87     __self__ = im_self\r
88     def __init__(self, func: Callable, obj: object) -> None: ...\r
89     def __call__(self, *args: Any, **kwargs: Any) -> Any: ...\r
90 \r
91 class InstanceType:\r
92     __doc__ = ...  # type: Optional[str]\r
93     __class__ = ...  # type: type\r
94     __module__ = ...  # type: Any\r
95 \r
96 MethodType = UnboundMethodType\r
97 \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
102 \r
103 class ModuleType:\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
111 FileType = file\r
112 XRangeType = xrange\r
113 \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
119 \r
120 class FrameType:\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
133 \r
134     def clear(self) -> None: ...\r
135 \r
136 SliceType = slice\r
137 class EllipsisType: ...\r
138 \r
139 class DictProxyType:\r
140     # TODO is it possible to have non-string keys?\r
141     # no __init__\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
155 \r
156 class NotImplementedType: ...\r
157 \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