lenskit.pipeline.Lazy#

class lenskit.pipeline.Lazy(*args, **kwargs)#

Bases: Protocol, Generic[T]

Type for accepting lazy inputs from the pipeline runner. If your function may or may not need one of its inputs, declare the type with this to only run it as needed:

def my_component(input: str, backup: Lazy[str]) -> str:
    if input == 'invalid':
        return backup.get()
    else:
        return input
__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

get()

Get the value behind this lazy instance.

get()#

Get the value behind this lazy instance.

Return type:

T