diff options
author | mathieui <mathieui@mathieui.net> | 2021-03-14 22:31:22 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-04-02 17:44:36 +0200 |
commit | 4b198be9771594a28824cc082e737fe15ab681ec (patch) | |
tree | 01de648647136734d176ba0fa33e96a61bbafc88 /poezio/decorators.py | |
parent | bc4f4f1e0766aedb6b0e9f3df90fee9ea841786c (diff) | |
download | poezio-4b198be9771594a28824cc082e737fe15ab681ec.tar.gz poezio-4b198be9771594a28824cc082e737fe15ab681ec.tar.bz2 poezio-4b198be9771594a28824cc082e737fe15ab681ec.tar.xz poezio-4b198be9771594a28824cc082e737fe15ab681ec.zip |
fix: tons of type errors
Diffstat (limited to 'poezio/decorators.py')
-rw-r--r-- | poezio/decorators.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/poezio/decorators.py b/poezio/decorators.py index a95e7348..ee138744 100644 --- a/poezio/decorators.py +++ b/poezio/decorators.py @@ -13,20 +13,19 @@ from typing import ( List, Optional, TypeVar, - TYPE_CHECKING, ) from poezio import common -if TYPE_CHECKING: - from poezio.tabs import RosterInfoTab T = TypeVar('T', bound=Callable[..., Any]) -BeforeFunc = Callable[[List[Any], Dict[str, Any]], Any] -AfterFunc = Callable[[List[Any], Dict[str, Any]], Any] -def wrap_generic(func: Callable, before: BeforeFunc=None, after: AfterFunc=None): +BeforeFunc = Optional[Callable[[List[Any], Dict[str, Any]], Any]] +AfterFunc = Optional[Callable[[Any, List[Any], Dict[str, Any]], Any]] + + +def wrap_generic(func: Callable, before: BeforeFunc = None, after: AfterFunc = None): """ Generic wrapper which can both wrap coroutines and normal functions. """ |