Image

Brian Okken: Python lazy imports you can use today

There’s a proposal,PEP 810 – Explicit lazy importsfor Python to natively support lazy importing starting in Python 3.15.

However, it has not been accepted yet, and even if it is accepted, 3.15 is a year away. What do we do now?

The techniques covered in this post that allow you to use lazy importing NOW with Python 3.13, Python 3.12, …, really every version of Python.

Let’s look at a small code example that imports something.

https://pythontest.com/python-lazy-imports-now/