Python Runtime 服務
*******************

The modules described in this chapter provide a wide range of services
related to the Python interpreter and its interaction with its
environment.  Here's an overview:

* "sys" --- 系統特定的參數與函式

* "sys.monitoring" --- Execution event monitoring

  * Tool identifiers

    * Registering and using tools

  * 事件

    * Local events

    * 輔助事件

    * 其他事件

    * The STOP_ITERATION event

  * Turning events on and off

    * Setting events globally

    * Per code object events

    * 停用事件

  * 註冊回呼函式

    * 回呼函式引數

* "sysconfig" --- 提供 Python 設定資訊的存取

  * Configuration variables

  * Installation paths

  * User scheme

    * "posix_user"

    * "nt_user"

    * "osx_framework_user"

  * Home scheme

    * "posix_home"

  * Prefix scheme

    * "posix_prefix"

    * "nt"

  * 安裝路徑函式

  * 其他函式

  * 將 "sysconfig" 作為腳本使用

* "builtins" --- 內建物件

* "__main__" --- 頂層程式碼環境

  * "__name__ == '__main__'"

    * 什麼是「頂層程式碼環境」？

    * 慣用 (Idiomatic) 用法

    * 打包時須考慮的事情

  * Python 套件中的 "__main__.py"

    * 慣用 (Idiomatic) 用法

  * "import __main__"

* "warnings" --- 警告控制

  * Warning Categories

  * The Warnings Filter

    * Describing Warning Filters

    * Default Warning Filter

    * Overriding the default filter

  * Temporarily Suppressing Warnings

  * Testing Warnings

  * Updating Code For New Versions of Dependencies

  * Available Functions

  * Available Context Managers

* "dataclasses" --- Data Classes

  * 模組內容

  * Post-init processing

  * 類別變數

  * Init-only variables

  * 凍結實例

  * 繼承

  * Re-ordering of keyword-only parameters in "__init__()"

  * 預設工廠函式

  * 可變預設值

  * Descriptor-typed fields

* "contextlib" --- Utilities for "with"-statement contexts

  * Utilities

  * Examples and Recipes

    * 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" --- 列印或取得堆疊回溯 (stack traceback)

  * "TracebackException" 物件

  * "StackSummary" 物件

  * "FrameSummary" 物件

  * Traceback Examples

* "__future__" --- Future 陳述式定義

  * 模組內容

* "gc" --- 垃圾回收器介面 (Garbage Collector interface)

* "inspect" --- 檢視活動物件

  * Types and members

  * 取得原始碼

  * Introspecting callables with the Signature object

  * 類別與函式

  * 直譯器堆疊

  * Fetching attributes statically

  * Current State of Generators, Coroutines, and Asynchronous
    Generators

  * Code Objects Bit Flags

  * Buffer flags

  * 命令列介面

* "site" --- Site-specific configuration hook

  * "sitecustomize"

  * "usercustomize"

  * Readline configuration

  * 模組內容

  * 命令列介面
