计划在 Python 3.15 中移除
*************************

* 导入系统：

  * 当设置 "__spec__.cached" 失败时在模块上设置 "__cached__" 的做法已
    被弃用。 在 Python 3.15 中，"__cached__" 将不会再被导入系统或标准
    库纳入考虑。 (gh-97879)

  * 当设备 "__spec__.parent" 失败时在模块上设置 "__package__" 的做法已
    被弃用。 在 Python 3.15 中，"__package__" 将不会再被导入系统或标准
    库纳入考虑。 (gh-97879)

* "ctypes":

  * 未写入文档的 "ctypes.SetPointerType()" 函数自 Python 3.13 起已被弃
    用。

* "http.server":

  * 过时且很少被使用的 "CGIHTTPRequestHandler" 自 Python 3.13 起已被弃
    用。 不存在直接的替代品。 对于建立带有请求处理器的 Web 服务器接口
    的任务来说 *任何东西* 都比 CGI 要好。

  * 用于 **python -m http.server** 命令行界面的 "--cgi" 旗标自 Python
    3.13 起已被弃用。

* "importlib":

  * "load_module()" 方法：改用 "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":

  * "java_ver()" 自 Python 3.13 起已被弃用。 此函数仅对 Jython 支持有
    用，具有令人困惑的 API，并且大部分未经测试。

* "sysconfig":

  * "sysconfig.is_python_build()" 的 *check_home* 参数自 Python 3.12
    起已被弃用。

* "threading":

  * 在 Python 3.15 中 "RLock()" 将不再接受参数。 传入参数的做法自
    Python 3.14 起已被弃用，因为 Python 版本不接受任何参数，而 C 版本
    允许任意数量的位置或关键字参数，但会忽略所有参数。

* "types":

  * "types.CodeType": 访问 "co_lnotab" 的做法自 3.10 起已根据 **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 起已被弃用。
    请改用基于类的语法或函数式语法。

  * 当使用 "TypedDict" 的函数式语法时，不向 *fields* 形参传递值 ("TD =
    TypedDict("TD")") 或传递 "None" ("TD = TypedDict("TD", None)") 的
    做法自 Python 3.13 起已被弃用。 请改用 "class TD(TypedDict): pass"
    或 "TD = TypedDict("TD", {})" 来创建一个零字段的 TypedDict。

  * "typing.no_type_check_decorator()" 装饰器自 Python 3.13 起已被弃用
    。 存在于 "typing" 模块八年之后，它仍未被任何主要类型检查器所支持
    。

* "wave":

  * "Wave_read" 和 "Wave_write" 类的 "getmark()", "setmark()" 和
    "getmarkers()" 方法自 Python 3.13 起已被弃用。

* "zipimport":

  * "load_module()" 自 Python 3.10 起已被弃用。 请改用 "exec_module()"
    。 （由李佳昊在 gh-125746 中贡献。）
