ws.utils.lazy module

class ws.utils.lazy.LazyProperty(func)

Bases: property

A descriptor wrapping a class method and exposing it as a lazily evaluated and cached property. It is intended to be used as a decorator.

The wrapped method is evaluated once on the first access and its return value is cached for fast subsequent accessing. The cached value can be reset by deleting the attribute using the del operator, e.g. del object.attribute, which will cause the wrapped method to be called again on the next access.