lazy 1.4 – Lazy Attributes

The lazy module provides a decorator to create lazy attributes. A lazy attribute is a computed attribute that is evaluated only once, the first time it is used. Subsequent uses return the results of the first call.

API Documentation

class lazy.lazy(func)

lazy descriptor.

Used as a decorator to create lazy attributes. Lazy attributes are evaluated on first use.

classmethod lazy.invalidate(inst, name)

Invalidate lazy attribute name of instance inst.

This obviously violates the lazy contract. Subclasses of lazy may however have a contract where invalidation is appropriate.

Indices and Tables