|
3 | 3 | import logging |
4 | 4 | import threading |
5 | 5 | from collections.abc import MutableMapping |
6 | | -from typing import Callable, Dict, Final, Iterator, List, Optional, Union |
| 6 | +from typing import Callable, Final, Iterator, Optional, Union |
7 | 7 |
|
8 | 8 | import can |
9 | 9 | from can import Listener |
@@ -40,10 +40,10 @@ def __init__(self, bus: Optional[can.BusABC] = None): |
40 | 40 | self.scanner = NodeScanner(self) |
41 | 41 | #: List of :class:`can.Listener` objects. |
42 | 42 | #: Includes at least MessageListener. |
43 | | - self.listeners = [MessageListener(self)] |
| 43 | + self.listeners: list[can.Listener] = [MessageListener(self)] |
44 | 44 | self.notifier: Optional[can.Notifier] = None |
45 | | - self.nodes: Dict[int, Union[RemoteNode, LocalNode]] = {} |
46 | | - self.subscribers: Dict[int, List[Callback]] = {} |
| 45 | + self.nodes: dict[int, Union[RemoteNode, LocalNode]] = {} |
| 46 | + self.subscribers: dict[int, list[Callback]] = {} |
47 | 47 | self.send_lock = threading.Lock() |
48 | 48 | self.sync = SyncProducer(self) |
49 | 49 | self.time = TimeProducer(self) |
@@ -396,7 +396,7 @@ def __init__(self, network: Optional[Network] = None): |
396 | 396 | network = _UNINITIALIZED_NETWORK |
397 | 397 | self.network: Network = network |
398 | 398 | #: A :class:`list` of nodes discovered |
399 | | - self.nodes: List[int] = [] |
| 399 | + self.nodes: list[int] = [] |
400 | 400 |
|
401 | 401 | def on_message_received(self, can_id: int): |
402 | 402 | service = can_id & 0x780 |
|
0 commit comments