UniCoreFW

flip()

Create a function that invokes func with arguments reversed.

Implementation

Example

Expected output:

Source Code

def flip(func: Callable) -> Callable: _validate_callable(func) def wrapper(*args, **kwargs): return func(*reversed(args), **kwargs) return _copy_function_metadata(wrapper, func)