Every import in #Python executes the module, from start to finish.

Meaning? Big modules slow down your program's startup time.

Coming in Python 3.15 this October: "lazy import", which delays the load until a name is used:

lazy import MODULE
lazy from MODULE import NAME

@Reuven ok, but if you do use it directly I assume the lazy import has a downside right? Otherwise you would just put lazy in front of all your imports
@hvdklauw @Reuven if you rely on side effects from importing the module, such as registration of plugins, that will not occur up front which could then affect operation of the application as may not see plugins are available. So can depend on what the module being imported does.
@grahamdumpleton @hvdklauw Right, I think that in most (normal, simple) cases, then you lose nothing from lazy loading. Your program will start up faster, and the load time will be spread throughout the program run. Certain modules do fancy/tricky things, and cannot be loaded lazily. But I think that "lazy import" is probably a good default to keep in mind, avoiding it only when needed.
@Reuven @hvdklauw Another risk, albeit small is that if you delay import, what might have shown up as an immediate failure of a program to load (because of a failure in side effects), will not show up until an arbitrary time later when the module finally gets lazily imported. This could complicate error handling and be confusing.