lenskit.lazy#

Types and functions for lazy values. These are used mostly for pipeline inputs.

Classes#

Lazy

Type for lazily-computed values.

Functions#

lazy_value(value)

Create a lazy wrapper for an already-computed value.

lazy_thunk(thunk)

Create a lazy value that calls the provided function to get the value as

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]