The “refactor the code” argument doesn’t work if lazy imports are used where typing-only imports would otherwise result in import cycles. One of the major non-performance related benefits of the PEP is that lazy imports can be used in place of if TYPE_CHECKING for this. Any time that happens though it will be broken by anyone using -X lazy_imports="disabled" which applies globally to every module in every library in the process.
12 Likes