accept and pass args and kwargs in trait constructors

This commit is contained in:
əlemi 2022-05-23 02:01:28 +02:00
parent 79886a2c64
commit 4c6d906d3a
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E
2 changed files with 4 additions and 3 deletions

View file

@ -12,8 +12,8 @@ class CallbacksHolder:
_callbacks : Dict[Any, List[Callable]]
_tasks : Dict[uuid.UUID, asyncio.Task]
def __init__(self):
super().__init__()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._callbacks = {}
self._tasks = {}

View file

@ -9,7 +9,8 @@ class Runnable:
_stop_task : Optional[asyncio.Task]
_loop : asyncio.AbstractEventLoop
def __init__(self):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._is_running = False
self._stop_task = None
self._loop = asyncio.get_event_loop()