Python运行时服务
****************

本章里描述的模块提供了和Python解释器及其环境交互相关的广泛服务。以下是
综述：

* "sys" --- 系统相关的参数和函数

* "sysconfig" —— 提供对 Python 配置信息的访问支持

  * 配置变量

  * 安装路径

  * 其他功能

  * Using "sysconfig" as 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-finally" and 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" --- 打印或检索堆栈回溯

  * "TracebackException" Objects

  * "StackSummary" Objects

  * "FrameSummary" Objects

  * 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（类库） 配置

  * 模块内容

  * 命令行界面
