lazy
Turn any callable into a lazy evaluated callable. result classes or types is required -- at least one is needed so that the automatic forcing of the lazy evaluation code is triggered. Results are not memoized; the function is evaluated on every access.
def lazy(
func: callable,
*resultclasses: type
) - > function
Turn any callable into a lazy evaluated callable. result classes or types is required -- at least one is needed so that the automatic forcing of the lazy evaluation code is triggered. Results are not memoized; the function is evaluated on every access.
Parameters
| Name | Type | Description |
|---|---|---|
| func | callable | The function or callable to be wrapped for lazy evaluation. |
| *resultclasses | type | One or more classes or types that the lazy object is expected to mimic; used to determine which methods should trigger evaluation. |
Returns
| Type | Description |
|---|---|
function | A wrapped version of the original function that returns a proxy object instead of the actual value. |