报告对 PEP 810 引入的 lazy import 的无效使用。
标记了以下使用:
try 主体中的 lazy import — lazy import 必须显示在模块级别;
lazy from ... import * — star import 不能为惰性;
lazy from __future__ import ... —
__future__ import 不能为惰性。
示例:
def f():
lazy import os # lazy import 必须显示在模块级别