updates to add type hinting to uses of Callable
This commit is contained in:
parent
b3118513fa
commit
dcabd8d6f8
9 changed files with 22 additions and 18 deletions
|
@ -1206,7 +1206,7 @@ class Session:
|
|||
ExceptionLevels.ERROR, "Session.run_state_hooks", None, message
|
||||
)
|
||||
|
||||
def add_state_hook(self, state: int, hook: Callable) -> None:
|
||||
def add_state_hook(self, state: int, hook: Callable[[int], None]) -> None:
|
||||
"""
|
||||
Add a state hook.
|
||||
|
||||
|
@ -1222,7 +1222,7 @@ class Session:
|
|||
if self.state == state:
|
||||
hook(state)
|
||||
|
||||
def del_state_hook(self, state: int, hook: Callable) -> None:
|
||||
def del_state_hook(self, state: int, hook: Callable[[int], None]) -> None:
|
||||
"""
|
||||
Delete a state hook.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue