The team migrated its back office to Python 3.15.2 and used PEP 810 lazy imports to make the CLI's --help roughly 4x faster, down from about 1.3 seconds. The post details six pull requests, a safety gate built before deferring any import, cases where lazy imports are not actually lazy, and why the TUI and MCP server entry points improved far less than the CLI.
Termsslug: lazy-import
Lazy Import
惰性导入
A deferred loading mechanism that executes module imports only when symbols are actually used, reducing startup time and memory
Curated Intelligence
Hacker News AIT2·Tools
58 pts
Simon Willison 博客T2·Tools
68 pts
Python 3.15 has been released, featuring explicit lazy imports via PEP 810 that defer module loading until first use. This significantly improves startup performance for projects with heavy dependencies, such as LLM CLI tools, while signaling the end of support for Python 3.10 and enabling developers to fully leverage features from version 3.11 onwards.