Skip to main content

keep_lazy

A decorator that allows a function to be called with one or more lazy arguments. If none of the args are lazy, the function is evaluated immediately, otherwise a proxy is returned that will evaluate the function when needed.

def keep_lazy(
*resultclasses: type
) - > function

A decorator that allows a function to be called with one or more lazy arguments. If none of the args are lazy, the function is evaluated immediately, otherwise a proxy is returned that will evaluate the function when needed.

Parameters

NameTypeDescription
*resultclassestypeOne or more classes that represent the expected return types of the decorated function, used to initialize the lazy proxy.

Returns

TypeDescription
functionA decorator function that wraps the target function to handle lazy evaluation logic based on input types.