raito.utils.helpers.safe_partial moduleΒΆ

raito.utils.helpers.safe_partial.safe_partial(func, /, **kwargs)[source]ΒΆ

Creates a partial version of a function, keeping only keyword arguments that are accepted by the original function.

Parameters:
  • func (Callable[[~P], R]) – The original function to partially apply

  • kwargs (Any) – Keyword arguments to bind

Returns:

A new callable with partially applied arguments

Return type:

Callable[[~P], R]