Python Lazy Imports PEP 810

The Story of Python's Lazy Imports: Why It Took Three Years and Two Attempts

You run mytool --help and wait. Two seconds. Three. No network requests, no error, no disk thrashing. Just Python dutifully loading PyTorch, NumPy, pandas, and a dozen other heavy libraries it will never touch — all so it can print a usage message and exit. This isn’t a hypothetical scenario from a conference slide deck. This is what Instagram engineers were dealing with every day in production. It’s what Hudson River Trading’s researchers were enduring across hundreds of CLI tools in their monorepo. And it’s the reason Python now has a lazy keyword coming in version 3.15 — though getting there took three years, two PEPs, a Steering Council rejection, a Language Summit showdown, and production evidence from some of the largest Python codebases on the planet. ...

March 8, 2026 · 13 min · TechLife