Python 运行时服务¶
本章描述的模块广泛服务于 Python 解释器及其与其环境的交互:
sys--- 系统相关的形参和函数sys.monitoring--- 执行事件监测sysconfig--- 提供对 Python 配置信息的访问builtins--- 内置对象__main__--- 最高层级代码环境warnings--- 警告信息控制dataclasses--- 数据类contextlib--- 为with语句上下文提供的工具abc--- 抽象基类atexit--- 退出处理器traceback--- 打印或读取栈回溯信息__future__--- Future 语句定义gc--- 垃圾回收器接口inspect--- 检查当前对象annotationlib--- 用于内省标记的功能site--- 站点专属的配置钩子
参见
参见
concurrent.interpreters模块,它以类似方式对外公开了核心运行时功能。