PEP 690: Lazy Imports Again

I thought this was one of the things that the PEP deliberately tried to avoid. If Python were to add lazy import then it will lead to pressure on library maintainers to support. And if they can’t or don’t want to support it, the pressure may not let up because new people will come in with the same requests over time, and there’s no syntax for being explicitly eager.

Maybe that’s an approach that could make PEP 690 better: add explicit eager import syntax? Library maintainers could mark their imports which must be eager, but it would no-op under a fully eager regime.

1 Like