Python运行时服务

本章里描述的模块提供了和Python解释器及其环境交互相关的广泛服务。以下是综述:
sys--- 系统相关的参数和函数sysconfig--- Provide access to Python's configuration information- 配置变量
- 安装路径
- 其他功能
- Using
sysconfigas a script
builtins--- 内建对象__main__--- 顶层脚本环境warnings—— 警告信息的控制- 警告类别
- 警告过滤器
- 警告过滤器的介绍
- 默认警告过滤器
- 重写默认的过滤器
- 暂时禁止警告
- 测试警告
- 为新版本的依赖关系更新代码
- 可用的函数
- 可用的上下文管理器
dataclasses--- 数据类- 模块级装饰器、类和函数
- 初始化后处理
- 类变量
- 仅初始化变量
- 冻结的实例
- 继承
- 默认工厂函数
- 可变的默认值
- 异常
contextlib--- 为with语句上下文提供的工具- 工具
- 例子和配方
- Supporting a variable number of context managers
- Catching exceptions from
__enter__methods - Cleaning up in an
__enter__implementation - Replacing any use of
try-finallyand flag variables - Using a context manager as a function decorator
- Single use, reusable and reentrant context managers
- Reentrant context managers
- Reusable context managers
abc--- 抽象基类atexit--- 退出处理器atexit示例
traceback--- 打印或检索堆栈回溯TracebackExceptionObjectsStackSummaryObjectsFrameSummaryObjects- Traceback Examples
__future__--- Future 语句定义gc--- 垃圾回收器接口inspect--- 检查对象- 类型和成员
- Retrieving source code
- Introspecting callables with the Signature object
- 类与函数
- The interpreter stack
- Fetching attributes statically
- Current State of Generators and Coroutines
- Code Objects Bit Flags
- 命令行界面
site—— 站点专属的配置钩子- Readline(类库) 配置
- 模块内容
- 命令行界面

