Skip to content

Make it easier to create and pass Lazy objects to pipelines #1047

@mdekstrand

Description

@mdekstrand

For testing (and perhaps other purposes), it would be useful to easily create Lazy objects to pass to pipelines. There are at least two that are likely useful:

  • An already-instantiated object (get just returns this value)
  • A memoized thunk (get calls a no-arg function)

Worked around with a local shim in CCRI-POPROX/poprox-recommender#295, but first-class support in LensKit is a good idea.

Possible alternate design: make Lazy[T] an alias for Callable[[], T], and then code can just pass lambda: val.

Metadata

Metadata

Assignees

No one assigned

    Labels

    POPROXTasks needed to support POPROX.pipelineLensKit pipeline abstraction

    Projects

    Status

    Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions