Skip to content

Commit

Permalink
feat: unset_initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Sep 13, 2024
1 parent 6e5f9b9 commit 2068409
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/timeout_executor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,28 @@ def remove_callback(self, callback: ProcessCallback[..., AnyT]) -> Self:
def set_initializer(
self, initializer: Callable[P, Any], *args: P.args, **kwargs: P.kwargs
) -> Self:
"""set initializer"""
"""set initializer
Args:
initializer: initializer function
*args: initializer args
**kwargs: initializer kwargs
Returns:
self
"""
self.initializer = InitializerArgs(
function=initializer, args=args, kwargs=kwargs
)
return self

def unset_initializer(self) -> Self:
"""unset initializer
to use chain method
Returns:
self
"""
self.initializer = None
return self

0 comments on commit 2068409

Please sign in to comment.