Hudson River Trading
Hudson River Trading logoHudson River Trading · Feature trail

Python Lazy Imports

2 posts · Jun 2023 – Aug 2025

What this trail covers

Hudson River Trading has fully adopted lazy imports across its Python monorepo, significantly improving script and notebook startup times and the efficiency of its distributed compute framework. This was achieved by forking CPython and implementing PEP 690's lazy import mechanism, which defers module resolution and evaluation until attributes are actually referenced. The migration involved addressing challenges with import side-effects, import ordering, and implicit transitive imports. HRT has a revised proposal for an explicit 'lazy' keyword in future PEPs.

All Hudson River Trading trails