2 # Ron Murawski <ron@horizonchess.com>
\r
4 # based on http://docs.python.org/3.2/library/sys.html
\r
7 List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional,
\r
8 Union, TypeVar, Callable, Type
\r
11 from types import FrameType, ModuleType, TracebackType
\r
13 from importlib.abc import MetaPathFinder
\r
17 # ----- sys variables -----
\r
20 base_exec_prefix: str
\r
23 builtin_module_names: Sequence[str] # actually a tuple of strings
\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
31 float_repr_style: str
\r
33 last_type: Optional[Type[BaseException]]
\r
34 last_value: Optional[BaseException]
\r
35 last_traceback: Optional[TracebackType]
\r
38 meta_path: List[MetaPathFinder]
\r
39 modules: Dict[str, ModuleType]
\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
53 # deprecated and removed in Python 3.3:
\r
54 subversion: Tuple[str, str, str]
\r
59 # Each entry is a tuple of the form (action, message, category, module,
\r
61 # winver = '' # Windows only
\r
62 _xoptions: Dict[Any, Any]
\r
68 division_warning: int
\r
72 dont_write_bytecode: int
\r
75 ignore_environment: int
\r
79 hash_randomization: int
\r
80 if sys.version_info >= (3, 7):
\r
83 float_info: _float_info
\r
85 epsilon: float # DBL_EPSILON
\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
97 hash_info: _hash_info
\r
105 implementation: _implementation
\r
106 class _implementation:
\r
108 version: _version_info
\r
112 int_info: _int_info
\r
114 bits_per_digit: int
\r
117 class _version_info(Tuple[int, int, int, str, int]):
\r
123 version_info: _version_info
\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
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
145 def getsizeof(obj: object) -> int: ...
\r
147 def getsizeof(obj: object, default: int) -> int: ...
\r
149 def getswitchinterval() -> float: ...
\r
152 def _getframe() -> FrameType: ...
\r
154 def _getframe(depth: int) -> FrameType: ...
\r
156 _ProfileFunc = Callable[[FrameType, str, Any], Any]
\r
157 def getprofile() -> Optional[_ProfileFunc]: ...
\r
158 def setprofile(profilefunc: Optional[_ProfileFunc]) -> None: ...
\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
165 class _WinVersion(Tuple[int, int, int, int,
\r
166 str, int, int, int, int,
\r
167 Tuple[int, int, int]]):
\r
173 service_pack_minor: int
\r
174 service_pack_major: int
\r
177 platform_version: Tuple[int, int, int]
\r
180 def getwindowsversion() -> _WinVersion: ... # Windows only
\r
181 def intern(string: str) -> str: ...
\r
183 if sys.version_info >= (3, 5):
\r
184 def is_finalizing() -> bool: ...
\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
192 def gettotalrefcount() -> int: ... # Debug builds only
\r