lenskit.lazy
Types and functions for lazy values. These are used mostly for pipeline inputs.
Module Contents
-
lenskit.lazy.lazy_value[T](value)
Create a lazy wrapper for an already-computed value.
- Parameters:
value (T) – The value to wrap in a lazy object.
- Returns:
A lazy wrapper for the already-computed value.
- Return type:
Lazy[T]
-
lenskit.lazy.lazy_thunk[T](thunk)
Create a lazy value that calls the provided function to get the value as
needed.
- Parameters:
thunk (Callable[[], T]) – The function to call to supply a value. Will only be called once.
- Returns:
A Lazy that will call the provided function.
- Return type:
Lazy[T]