From 20684095a3192e184d3afb1dcb7aa66ceb6c3cd7 Mon Sep 17 00:00:00 2001 From: phi Date: Fri, 13 Sep 2024 13:10:02 +0900 Subject: [PATCH] feat: unset_initializer --- src/timeout_executor/main.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/timeout_executor/main.py b/src/timeout_executor/main.py index 5259eab..a097932 100644 --- a/src/timeout_executor/main.py +++ b/src/timeout_executor/main.py @@ -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