massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 3 / sys.pyi
1 # Stubs for sys\r
2 # Ron Murawski <ron@horizonchess.com>\r
3 \r
4 # based on http://docs.python.org/3.2/library/sys.html\r
5 \r
6 from typing import (\r
7     List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional,\r
8     Union, TypeVar, Callable, Type\r
9 )\r
10 import sys\r
11 from types import FrameType, ModuleType, TracebackType\r
12 \r
13 from importlib.abc import MetaPathFinder\r
14 \r
15 _T = TypeVar('_T')\r
16 \r
17 # ----- sys variables -----\r
18 abiflags: str\r
19 argv: List[str]\r
20 base_exec_prefix: str\r
21 base_prefix: str\r
22 byteorder: str\r
23 builtin_module_names: Sequence[str]  # actually a tuple of strings\r
24 copyright: str\r
25 # dllhandle = 0  # Windows only\r
26 dont_write_bytecode: bool\r
27 __displayhook__: Any  # contains the original value of displayhook\r
28 __excepthook__: Any  # contains the original value of excepthook\r
29 exec_prefix: str\r
30 executable: str\r
31 float_repr_style: str\r
32 hexversion: int\r
33 last_type: Optional[Type[BaseException]]\r
34 last_value: Optional[BaseException]\r
35 last_traceback: Optional[TracebackType]\r
36 maxsize: int\r
37 maxunicode: int\r
38 meta_path: List[MetaPathFinder]\r
39 modules: Dict[str, ModuleType]\r
40 path: List[str]\r
41 path_hooks: List[Any]  # TODO precise type; function, path to finder\r
42 path_importer_cache: Dict[str, Any]  # TODO precise type\r
43 platform: str\r
44 prefix: str\r
45 ps1: str\r
46 ps2: str\r
47 stdin: TextIO\r
48 stdout: TextIO\r
49 stderr: TextIO\r
50 __stdin__: TextIO\r
51 __stdout__: TextIO\r
52 __stderr__: TextIO\r
53 # deprecated and removed in Python 3.3:\r
54 subversion: Tuple[str, str, str]\r
55 tracebacklimit: int\r
56 version: str\r
57 api_version: int\r
58 warnoptions: Any\r
59 #  Each entry is a tuple of the form (action, message, category, module,\r
60 #    lineno)\r
61 # winver = ''  # Windows only\r
62 _xoptions: Dict[Any, Any]\r
63 \r
64 \r
65 flags: _flags\r
66 class _flags:\r
67     debug: int\r
68     division_warning: int\r
69     inspect: int\r
70     interactive: int\r
71     optimize: int\r
72     dont_write_bytecode: int\r
73     no_user_site: int\r
74     no_site: int\r
75     ignore_environment: int\r
76     verbose: int\r
77     bytes_warning: int\r
78     quiet: int\r
79     hash_randomization: int\r
80     if sys.version_info >= (3, 7):\r
81         dev_mode: int\r
82 \r
83 float_info: _float_info\r
84 class _float_info:\r
85     epsilon: float   # DBL_EPSILON\r
86     dig: int         # DBL_DIG\r
87     mant_dig: int    # DBL_MANT_DIG\r
88     max: float       # DBL_MAX\r
89     max_exp: int     # DBL_MAX_EXP\r
90     max_10_exp: int  # DBL_MAX_10_EXP\r
91     min: float       # DBL_MIN\r
92     min_exp: int     # DBL_MIN_EXP\r
93     min_10_exp: int  # DBL_MIN_10_EXP\r
94     radix: int       # FLT_RADIX\r
95     rounds: int      # FLT_ROUNDS\r
96 \r
97 hash_info: _hash_info\r
98 class _hash_info:\r
99     width: int\r
100     modulus: int\r
101     inf: int\r
102     nan: int\r
103     imag: int\r
104 \r
105 implementation: _implementation\r
106 class _implementation:\r
107     name: str\r
108     version: _version_info\r
109     hexversion: int\r
110     cache_tag: str\r
111 \r
112 int_info: _int_info\r
113 class _int_info:\r
114     bits_per_digit: int\r
115     sizeof_digit: int\r
116 \r
117 class _version_info(Tuple[int, int, int, str, int]):\r
118     major: int\r
119     minor: int\r
120     micro: int\r
121     releaselevel: str\r
122     serial: int\r
123 version_info: _version_info\r
124 \r
125 def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ...\r
126 def _clear_type_cache() -> None: ...\r
127 def _current_frames() -> Dict[int, Any]: ...\r
128 def displayhook(value: Optional[int]) -> None: ...\r
129 def excepthook(type_: Type[BaseException], value: BaseException,\r
130                traceback: TracebackType) -> None: ...\r
131 def exc_info() -> Tuple[Optional[Type[BaseException]],\r
132                         Optional[BaseException],\r
133                         Optional[TracebackType]]: ...\r
134 # sys.exit() accepts an optional argument of anything printable\r
135 def exit(arg: object = ...) -> NoReturn:\r
136     raise SystemExit()\r
137 def getcheckinterval() -> int: ...  # deprecated\r
138 def getdefaultencoding() -> str: ...\r
139 def getdlopenflags() -> int: ...  # Unix only\r
140 def getfilesystemencoding() -> str: ...\r
141 def getrefcount(arg: Any) -> int: ...\r
142 def getrecursionlimit() -> int: ...\r
143 \r
144 @overload\r
145 def getsizeof(obj: object) -> int: ...\r
146 @overload\r
147 def getsizeof(obj: object, default: int) -> int: ...\r
148 \r
149 def getswitchinterval() -> float: ...\r
150 \r
151 @overload\r
152 def _getframe() -> FrameType: ...\r
153 @overload\r
154 def _getframe(depth: int) -> FrameType: ...\r
155 \r
156 _ProfileFunc = Callable[[FrameType, str, Any], Any]\r
157 def getprofile() -> Optional[_ProfileFunc]: ...\r
158 def setprofile(profilefunc: Optional[_ProfileFunc]) -> None: ...\r
159 \r
160 _TraceFunc = Callable[[FrameType, str, Any], Optional[Callable[[FrameType, str, Any], Any]]]\r
161 def gettrace() -> Optional[_TraceFunc]: ...\r
162 def settrace(tracefunc: _TraceFunc) -> None: ...\r
163 \r
164 \r
165 class _WinVersion(Tuple[int, int, int, int,\r
166                         str, int, int, int, int,\r
167                         Tuple[int, int, int]]):\r
168     major: int\r
169     minor: int\r
170     build: int\r
171     platform: int\r
172     service_pack: str\r
173     service_pack_minor: int\r
174     service_pack_major: int\r
175     suite_mast: int\r
176     product_type: int\r
177     platform_version: Tuple[int, int, int]\r
178 \r
179 \r
180 def getwindowsversion() -> _WinVersion: ...  # Windows only\r
181 def intern(string: str) -> str: ...\r
182 \r
183 if sys.version_info >= (3, 5):\r
184     def is_finalizing() -> bool: ...\r
185 \r
186 def setcheckinterval(interval: int) -> None: ...  # deprecated\r
187 def setdlopenflags(n: int) -> None: ...  # Linux only\r
188 def setrecursionlimit(limit: int) -> None: ...\r
189 def setswitchinterval(interval: float) -> None: ...\r
190 def settscdump(on_flag: bool) -> None: ...\r
191 \r
192 def gettotalrefcount() -> int: ...  # Debug builds only\r