Python 3.15 中待移除的項目
**************************

* 引入系統 (import system)：

  * 在模組上設定 "__cached__" 而沒有設定 "__spec__.cached" 的做法已被
    棄用。在 Python 3.15 中，引入系統或標準函式庫將不再設定或考慮
    "__cached__"。(gh-97879)

  * 在模組上設定 "__package__" 而沒有設定 "__spec__.parent" 的做法已被
    棄用。在 Python 3.15 中，引入系統或標準函式庫將不再設定或考慮
    "__package__"。(gh-97879)

* "ctypes"：

  * 自 Python 3.13 起，未記錄的 "ctypes.SetPointerType()" 函式已被棄用
    。

* "http.server"：

  * 過時且很少使用的 "CGIHTTPRequestHandler" 自 Python 3.13 起已被棄用
    。不存在直接的替代。*任何東西*都比 CGI 更好地將 Web 伺服器與請求處
    理程序介接起來。

  * 自 Python 3.13 起，**python -m http.server** 命令列介面的 "--cgi"
    旗標已被棄用。

* "importlib"：

  * "load_module()" method：請改用 "exec_module()"。

* "locale"：

  * "getdefaultlocale()" 已在 Python 3.11 中被棄用，原本計劃在 Python
    3.13 中移除 (gh-90817)，但被延後至 Python 3.15。請改用
    "getlocale()"、"setlocale()" 和 "getencoding()"。 (由 Hugo van
    Kemenade 於 gh-111187 貢獻。)

* "pathlib"：

  * "PurePath.is_reserved()" 已自 Python 3.13 被棄用。請用
    "os.path.isreserved()" 來偵測 Windows 上的保留路徑。

* "platform"：

  * 自 Python 3.13 起，"java_ver()" 已被棄用。此函式僅對 Jython 支援有
    用，具有令人困惑的 API，基本上未經測試。

* "sysconfig"：

  * "sysconfig.is_python_build()" 的 *check_home* 引數自 Python 3.12
    起已被棄用。

* "threading"：

  * "RLock()" 在 Python 3.15 中將不接受任何引數。自 Python 3.14 起，傳
    遞任何引數的用法已被棄用，因為 Python 版本不允許任何引數，但 C 版
    本允許任意數量的位置或關鍵字引數，並忽略每個引數。

* "types"：

  * "types.CodeType"：自 3.10 起，存取 "co_lnotab" 已在 **PEP 626** 中
    被棄用，並計劃在 3.12 中移除，但只在 3.12 中於適當時發出
    "DeprecationWarning"。可能在 3.15 中移除。（由 Nikita Sobolev 於
    gh-101866 貢獻。）

* "typing"：

  * 用於建立 "NamedTuple" 類別的未以文件記錄之關鍵字引數語法 ("Point =
    NamedTuple("Point", x=int, y=int)") 已自 Python 3.13 棄用。請改用
    基於類別的語法或函式語法 (functional syntax)。

  * 當使用 "TypedDict" 的函式語法時，未傳遞值給 *fields* 參數 ("TD =
    TypedDict("TD")") 或傳遞 "None" ("TD = TypedDict("TD", None)") 的
    做法自 Python 3.13 起已被棄用。請使用 "class TD(TypedDict): pass"
    或 "TD = TypedDict("TD", {})" 來建立具有零個欄位的 TypedDict。

  * 自 Python 3.13 起，"typing.no_type_check_decorator()" 裝飾器函式已
    被棄用。在 "typing" 模組中使用了八年之後，它尚未得到任何主要型別檢
    查器的支援。

* "wave"：

  * 已棄用 "Wave_read" 和 "Wave_write" 類別的 "getmark()"、"setmark()"
    和 "getmarkers()" 方法自 Python 3.13 被棄用。

* "zipimport"：

  * "load_module()" 自 Python 3.10 被棄用。請改用 "exec_module()"。（
    由 Jiahao Li 於 gh-125746 貢獻。）
