aspis.internal.eager_partial
- aspis.internal.eager_partial(fn, *args, **kwargs)[source]
Partially applies arguments to a function and returns the result immediately if all arguments are provided. Otherwise, returns a new function awaiting the rest.
Note: Keyword Arguments are prioritized over positional arguments.
- Parameters:
fn (Callable[..., T]) – Function to apply arguments to.
*args (Any) – List of arguments to apply to the function.
**kwargs (Any) – List of keyword arguments to apply to the function.
- Returns:
- Partially applied function if not all arguments are provided,
else the result of the function.
- Return type:
Callable[…, T] | T