Format: application/octet-stream
⬇ Download File (3.5 KB)
   1  from types import ClassType, FrameType, ModuleType, TracebackType
   2  from typing import IO, Any, BinaryIO, Callable, Dict, List, NoReturn, Optional, Sequence, Text, Tuple, Type, Union, overload
   3  
   4  # The following type alias are stub-only and do not exist during runtime
   5  _ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType]
   6  _OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]]
   7  
   8  class _flags:
   9      bytes_warning: int
  10      debug: int
  11      division_new: int
  12      division_warning: int
  13      dont_write_bytecode: int
  14      hash_randomization: int
  15      ignore_environment: int
  16      inspect: int
  17      interactive: int
  18      no_site: int
  19      no_user_site: int
  20      optimize: int
  21      py3k_warning: int
  22      tabcheck: int
  23      unicode: int
  24      verbose: int
  25  
  26  class _float_info:
  27      max: float
  28      max_exp: int
  29      max_10_exp: int
  30      min: float
  31      min_exp: int
  32      min_10_exp: int
  33      dig: int
  34      mant_dig: int
  35      epsilon: float
  36      radix: int
  37      rounds: int
  38  
  39  class _version_info(Tuple[int, int, int, str, int]):
  40      major: int
  41      minor: int
  42      micro: int
  43      releaselevel: str
  44      serial: int
  45  
  46  _mercurial: Tuple[str, str, str]
  47  api_version: int
  48  argv: List[str]
  49  builtin_module_names: Tuple[str, ...]
  50  byteorder: str
  51  copyright: str
  52  dont_write_bytecode: bool
  53  exec_prefix: str
  54  executable: str
  55  flags: _flags
  56  float_repr_style: str
  57  hexversion: int
  58  long_info: object
  59  maxint: int
  60  maxsize: int
  61  maxunicode: int
  62  modules: Dict[str, Any]
  63  path: List[str]
  64  platform: str
  65  prefix: str
  66  py3kwarning: bool
  67  __stderr__: IO[str]
  68  __stdin__: IO[str]
  69  __stdout__: IO[str]
  70  stderr: IO[str]
  71  stdin: IO[str]
  72  stdout: IO[str]
  73  subversion: Tuple[str, str, str]
  74  version: str
  75  warnoptions: object
  76  float_info: _float_info
  77  version_info: _version_info
  78  ps1: str
  79  ps2: str
  80  last_type: type
  81  last_value: BaseException
  82  last_traceback: TracebackType
  83  # TODO precise types
  84  meta_path: List[Any]
  85  path_hooks: List[Any]
  86  path_importer_cache: Dict[str, Any]
  87  displayhook: Callable[[object], Any]
  88  excepthook: Callable[[Type[BaseException], BaseException, TracebackType], Any]
  89  exc_type: Optional[type]
  90  exc_value: Union[BaseException, ClassType]
  91  exc_traceback: TracebackType
  92  
  93  class _WindowsVersionType:
  94      major: Any
  95      minor: Any
  96      build: Any
  97      platform: Any
  98      service_pack: Any
  99      service_pack_major: Any
 100      service_pack_minor: Any
 101      suite_mask: Any
 102      product_type: Any
 103  
 104  def getwindowsversion() -> _WindowsVersionType: ...
 105  def _clear_type_cache() -> None: ...
 106  def _current_frames() -> Dict[int, FrameType]: ...
 107  def _getframe(depth: int = ...) -> FrameType: ...
 108  def call_tracing(fn: Any, args: Any) -> Any: ...
 109  def __displayhook__(value: object) -> None: ...
 110  def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ...
 111  def exc_clear() -> None: ...
 112  def exc_info() -> _OptExcInfo: ...
 113  
 114  # sys.exit() accepts an optional argument of anything printable
 115  def exit(arg: Any = ...) -> NoReturn: ...
 116  def getcheckinterval() -> int: ...  # deprecated
 117  def getdefaultencoding() -> str: ...
 118  def getdlopenflags() -> int: ...
 119  def getfilesystemencoding() -> str: ...  # In practice, never returns None
 120  def getrefcount(arg: Any) -> int: ...
 121  def getrecursionlimit() -> int: ...
 122  def getsizeof(obj: object, default: int = ...) -> int: ...
 123  def getprofile() -> Optional[Any]: ...
 124  def gettrace() -> Optional[Any]: ...
 125  def setcheckinterval(interval: int) -> None: ...  # deprecated
 126  def setdlopenflags(n: int) -> None: ...
 127  def setdefaultencoding(encoding: Text) -> None: ...  # only exists after reload(sys)
 128  def setprofile(profilefunc: Any) -> None: ...  # TODO type
 129  def setrecursionlimit(limit: int) -> None: ...
 130  def settrace(tracefunc: Any) -> None: ...  # TODO type
 131