Summary
PEP 810 (Explicit lazy imports) specifically calls out lazy imports as eliminat[ing] the common need for TYPE_CHECKING guards. While TYPE_CHECKING may still have a use for avoiding circular imports, it's does cause a lot of issues for tools that rely on runtime behavior (think: sphinx.ext.autodoc, beartype, etc.). Would it make sense to deprecate these rules or discourage their use code bases that only support Python 3.15 or greater, on the basis that users would be better off using lazy imports to avoid these expensive imports?
Summary
PEP 810 (Explicit lazy imports) specifically calls out lazy imports as eliminat[ing] the common need for
TYPE_CHECKINGguards. WhileTYPE_CHECKINGmay still have a use for avoiding circular imports, it's does cause a lot of issues for tools that rely on runtime behavior (think: sphinx.ext.autodoc, beartype, etc.). Would it make sense to deprecate these rules or discourage their use code bases that only support Python 3.15 or greater, on the basis that users would be better off using lazy imports to avoid these expensive imports?