Skip to content

Commit

Permalink
[FIX](handlers) return value for __call__
Browse files Browse the repository at this point in the history
  • Loading branch information
wbenbihi committed Aug 25, 2022
1 parent 6dd1c2b commit 5a26b66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hourglass_tensorflow/handlers/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ def __init__(
self._executed = False
self.init_handler(*args, **kwargs)

def __call__(self, *args, **kwargs) -> None:
def __call__(self: Self, *args, **kwargs) -> Self:
if not self._executed:
self.run(*args, **kwargs)
self.executed = True
else:
self.warning(
f"This {self.__class__.__name__} has already been executed. Use self.reset"
)
return self

def __repr__(self) -> str:
return f"<Handler:{self.__class__.__name__}: {self.config}>"
Expand Down

0 comments on commit 5a26b66

Please sign in to comment.