Python运行时服务¶
本章里描述的模块提供了和Python解释器及其环境交互相关的广泛服务。以下是综述:
- sys--- 系统相关的形参和函数
- sys.monitoring--- Execution event monitoring
- sysconfig—— 提供对 Python 配置信息的访问支持
- builtins--- 内建对象
- __main__--- 最高层级代码环境
- warnings—— 警告信息的控制
- dataclasses--- 数据类
- contextlib--- 为- with语句上下文提供的工具
- abc--- 抽象基类
- atexit--- 退出处理器
- traceback—— 打印或读取栈回溯信息
- __future__--- Future 语句定义
- gc--- 垃圾回收器接口
- inspect--- 检查对象
- site—— 指定域的配置钩子