Concerns about `-X lazy_imports=none`

I think earlier versions of the text did not. They did however have the surviving claim that:

Lazy imports eliminate the common need for TYPE_CHECKING guards.

I pointed out that this was in contradiction with lazy_imports=none because the TYPE_CHECKING blocks are commonly used in libraries to avoid circular imports for typing-only imports. At the time some text was added to the PEP to the effect of “don’t expect lazy_imports=none to work with any libraries” but I don’t see where that text is now. It seemed obvious to me that lazy_imports=none would become unusable as soon as any libraries adopted lazy imports.

3 Likes