Skip to content

Commit 564d10e

Browse files
committed
Upd ver
1 parent 0468c62 commit 564d10e

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

thingsdb/room/roombase.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import abc
22
import asyncio
33
import logging
4+
from typing import Callable, TypeVar, ParamSpec
45
from ..client import Client
56
from ..client.protocol import Proto
67
from ..util.is_name import is_name
78

89

10+
P = ParamSpec('P')
11+
R = TypeVar('R')
12+
13+
914
class RoomBase(abc.ABC):
1015

1116
def __init_subclass__(cls):
@@ -261,9 +266,9 @@ def _emit_handler(self, data):
261266
}
262267

263268
@staticmethod
264-
def event(event: str):
265-
def wrapped(fun):
266-
fun._event = event
269+
def event(event: str) -> Callable[[Callable[P, R]], Callable[P, R]]:
270+
def wrapped(fun: Callable[P, R]) -> Callable[P, R]:
271+
setattr(fun, '_event', event)
267272
return fun
268273

269274
return wrapped

thingsdb/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.2.0'
1+
__version__ = '1.2.1'

0 commit comments

Comments
 (0)