mirror of
https://github.com/craigerl/aprsd.git
synced 2026-05-14 21:32:40 -04:00
style(threads): add return type to loop() and use modern type hints
- Add -> bool return type annotation to abstract loop() method - Replace 'from typing import List' with built-in list[] (Python 3.9+)
This commit is contained in:
parent
bf258e4bcf
commit
8d8648e9dd
@ -2,7 +2,6 @@ import abc
|
||||
import datetime
|
||||
import logging
|
||||
import threading
|
||||
from typing import List
|
||||
|
||||
import wrapt
|
||||
|
||||
@ -61,7 +60,7 @@ class APRSDThread(threading.Thread, metaclass=abc.ABCMeta):
|
||||
return self._shutdown_event.wait(timeout=wait_time)
|
||||
|
||||
@abc.abstractmethod
|
||||
def loop(self):
|
||||
def loop(self) -> bool:
|
||||
pass
|
||||
|
||||
def _cleanup(self):
|
||||
@ -98,7 +97,7 @@ class APRSDThreadList:
|
||||
|
||||
_instance = None
|
||||
|
||||
threads_list: List[APRSDThread] = []
|
||||
threads_list: list[APRSDThread] = []
|
||||
lock = threading.Lock()
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user