UniCoreFW

constant()

Return a function that always returns the specified value.

Implementation

Args: value: The value to return Returns: A function that always returns the value

Example

constant(42)

Expected output: 42

Source Code

def constant(value: T) -> Callable[[], T]: return lambda: value