stouputils.lazy module#

Marker that defers every import of a module under PEP 810.

Python 3.15 decides whether an import is lazy by evaluating name in __lazy_modules__, and the specification only requires that object to support __contains__. Answering yes to everything keeps the declaration down to one shared marker per module, instead of a list that has to be kept in step with every import statement. Older Python versions ignore __lazy_modules__ entirely.

Star imports, __future__ imports and imports inside a try block stay eager whatever this marker says, since PEP 810 refuses to defer those.

class AlwaysLazy[source]#

Bases: object

Container that reports every module name as deferrable.

ALWAYS_LAZY: AlwaysLazy = <stouputils.lazy.AlwaysLazy object>[source]#

Shared marker assigned to __lazy_modules__ at the top of every module in the package.