--- /dev/null
+# Stubs for sys\r
+# Ron Murawski <ron@horizonchess.com>\r
+\r
+# based on http://docs.python.org/3.2/library/sys.html\r
+\r
+from typing import (\r
+ List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional,\r
+ Union, TypeVar, Callable, Type\r
+)\r
+import sys\r
+from types import FrameType, ModuleType, TracebackType\r
+\r
+from importlib.abc import MetaPathFinder\r
+\r
+_T = TypeVar('_T')\r
+\r
+# ----- sys variables -----\r
+abiflags: str\r
+argv: List[str]\r
+base_exec_prefix: str\r
+base_prefix: str\r
+byteorder: str\r
+builtin_module_names: Sequence[str] # actually a tuple of strings\r
+copyright: str\r
+# dllhandle = 0 # Windows only\r
+dont_write_bytecode: bool\r
+__displayhook__: Any # contains the original value of displayhook\r
+__excepthook__: Any # contains the original value of excepthook\r
+exec_prefix: str\r
+executable: str\r
+float_repr_style: str\r
+hexversion: int\r
+last_type: Optional[Type[BaseException]]\r
+last_value: Optional[BaseException]\r
+last_traceback: Optional[TracebackType]\r
+maxsize: int\r
+maxunicode: int\r
+meta_path: List[MetaPathFinder]\r
+modules: Dict[str, ModuleType]\r
+path: List[str]\r
+path_hooks: List[Any] # TODO precise type; function, path to finder\r
+path_importer_cache: Dict[str, Any] # TODO precise type\r
+platform: str\r
+prefix: str\r
+ps1: str\r
+ps2: str\r
+stdin: TextIO\r
+stdout: TextIO\r
+stderr: TextIO\r
+__stdin__: TextIO\r
+__stdout__: TextIO\r
+__stderr__: TextIO\r
+# deprecated and removed in Python 3.3:\r
+subversion: Tuple[str, str, str]\r
+tracebacklimit: int\r
+version: str\r
+api_version: int\r
+warnoptions: Any\r
+# Each entry is a tuple of the form (action, message, category, module,\r
+# lineno)\r
+# winver = '' # Windows only\r
+_xoptions: Dict[Any, Any]\r
+\r
+\r
+flags: _flags\r
+class _flags:\r
+ debug: int\r
+ division_warning: int\r
+ inspect: int\r
+ interactive: int\r
+ optimize: int\r
+ dont_write_bytecode: int\r
+ no_user_site: int\r
+ no_site: int\r
+ ignore_environment: int\r
+ verbose: int\r
+ bytes_warning: int\r
+ quiet: int\r
+ hash_randomization: int\r
+ if sys.version_info >= (3, 7):\r
+ dev_mode: int\r
+\r
+float_info: _float_info\r
+class _float_info:\r
+ epsilon: float # DBL_EPSILON\r
+ dig: int # DBL_DIG\r
+ mant_dig: int # DBL_MANT_DIG\r
+ max: float # DBL_MAX\r
+ max_exp: int # DBL_MAX_EXP\r
+ max_10_exp: int # DBL_MAX_10_EXP\r
+ min: float # DBL_MIN\r
+ min_exp: int # DBL_MIN_EXP\r
+ min_10_exp: int # DBL_MIN_10_EXP\r
+ radix: int # FLT_RADIX\r
+ rounds: int # FLT_ROUNDS\r
+\r
+hash_info: _hash_info\r
+class _hash_info:\r
+ width: int\r
+ modulus: int\r
+ inf: int\r
+ nan: int\r
+ imag: int\r
+\r
+implementation: _implementation\r
+class _implementation:\r
+ name: str\r
+ version: _version_info\r
+ hexversion: int\r
+ cache_tag: str\r
+\r
+int_info: _int_info\r
+class _int_info:\r
+ bits_per_digit: int\r
+ sizeof_digit: int\r
+\r
+class _version_info(Tuple[int, int, int, str, int]):\r
+ major: int\r
+ minor: int\r
+ micro: int\r
+ releaselevel: str\r
+ serial: int\r
+version_info: _version_info\r
+\r
+def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ...\r
+def _clear_type_cache() -> None: ...\r
+def _current_frames() -> Dict[int, Any]: ...\r
+def displayhook(value: Optional[int]) -> None: ...\r
+def excepthook(type_: Type[BaseException], value: BaseException,\r
+ traceback: TracebackType) -> None: ...\r
+def exc_info() -> Tuple[Optional[Type[BaseException]],\r
+ Optional[BaseException],\r
+ Optional[TracebackType]]: ...\r
+# sys.exit() accepts an optional argument of anything printable\r
+def exit(arg: object = ...) -> NoReturn:\r
+ raise SystemExit()\r
+def getcheckinterval() -> int: ... # deprecated\r
+def getdefaultencoding() -> str: ...\r
+def getdlopenflags() -> int: ... # Unix only\r
+def getfilesystemencoding() -> str: ...\r
+def getrefcount(arg: Any) -> int: ...\r
+def getrecursionlimit() -> int: ...\r
+\r
+@overload\r
+def getsizeof(obj: object) -> int: ...\r
+@overload\r
+def getsizeof(obj: object, default: int) -> int: ...\r
+\r
+def getswitchinterval() -> float: ...\r
+\r
+@overload\r
+def _getframe() -> FrameType: ...\r
+@overload\r
+def _getframe(depth: int) -> FrameType: ...\r
+\r
+_ProfileFunc = Callable[[FrameType, str, Any], Any]\r
+def getprofile() -> Optional[_ProfileFunc]: ...\r
+def setprofile(profilefunc: Optional[_ProfileFunc]) -> None: ...\r
+\r
+_TraceFunc = Callable[[FrameType, str, Any], Optional[Callable[[FrameType, str, Any], Any]]]\r
+def gettrace() -> Optional[_TraceFunc]: ...\r
+def settrace(tracefunc: _TraceFunc) -> None: ...\r
+\r
+\r
+class _WinVersion(Tuple[int, int, int, int,\r
+ str, int, int, int, int,\r
+ Tuple[int, int, int]]):\r
+ major: int\r
+ minor: int\r
+ build: int\r
+ platform: int\r
+ service_pack: str\r
+ service_pack_minor: int\r
+ service_pack_major: int\r
+ suite_mast: int\r
+ product_type: int\r
+ platform_version: Tuple[int, int, int]\r
+\r
+\r
+def getwindowsversion() -> _WinVersion: ... # Windows only\r
+def intern(string: str) -> str: ...\r
+\r
+if sys.version_info >= (3, 5):\r
+ def is_finalizing() -> bool: ...\r
+\r
+def setcheckinterval(interval: int) -> None: ... # deprecated\r
+def setdlopenflags(n: int) -> None: ... # Linux only\r
+def setrecursionlimit(limit: int) -> None: ...\r
+def setswitchinterval(interval: float) -> None: ...\r
+def settscdump(on_flag: bool) -> None: ...\r
+\r
+def gettotalrefcount() -> int: ... # Debug builds only\r