|
11 | 11 | - Ronny Pfannschmidt |
12 | 12 | - many others |
13 | 13 | """ |
| 14 | + |
14 | 15 | from __future__ import annotations |
15 | 16 |
|
16 | 17 | import abc |
|
32 | 33 |
|
33 | 34 |
|
34 | 35 | class WriteIO(Protocol): |
35 | | - def write(self, data: bytes, /) -> None: |
36 | | - ... |
| 36 | + def write(self, data: bytes, /) -> None: ... |
37 | 37 |
|
38 | 38 |
|
39 | 39 | class ReadIO(Protocol): |
40 | | - def read(self, numbytes: int, /) -> bytes: |
41 | | - ... |
| 40 | + def read(self, numbytes: int, /) -> bytes: ... |
42 | 41 |
|
43 | 42 |
|
44 | 43 | class IO(Protocol): |
45 | 44 | execmodel: ExecModel |
46 | 45 |
|
47 | | - def read(self, numbytes: int, /) -> bytes: |
48 | | - ... |
| 46 | + def read(self, numbytes: int, /) -> bytes: ... |
49 | 47 |
|
50 | | - def write(self, data: bytes, /) -> None: |
51 | | - ... |
| 48 | + def write(self, data: bytes, /) -> None: ... |
52 | 49 |
|
53 | | - def close_read(self) -> None: |
54 | | - ... |
| 50 | + def close_read(self) -> None: ... |
55 | 51 |
|
56 | | - def close_write(self) -> None: |
57 | | - ... |
| 52 | + def close_write(self) -> None: ... |
58 | 53 |
|
59 | | - def wait(self) -> int | None: |
60 | | - ... |
| 54 | + def wait(self) -> int | None: ... |
61 | 55 |
|
62 | | - def kill(self) -> None: |
63 | | - ... |
| 56 | + def kill(self) -> None: ... |
64 | 57 |
|
65 | 58 |
|
66 | 59 | class Event(Protocol): |
67 | 60 | """Protocol for types which look like threading.Event.""" |
68 | 61 |
|
69 | | - def is_set(self) -> bool: |
70 | | - ... |
| 62 | + def is_set(self) -> bool: ... |
71 | 63 |
|
72 | | - def set(self) -> None: |
73 | | - ... |
| 64 | + def set(self) -> None: ... |
74 | 65 |
|
75 | | - def clear(self) -> None: |
76 | | - ... |
| 66 | + def clear(self) -> None: ... |
77 | 67 |
|
78 | | - def wait(self, timeout: float | None = None) -> bool: |
79 | | - ... |
| 68 | + def wait(self, timeout: float | None = None) -> bool: ... |
80 | 69 |
|
81 | 70 |
|
82 | 71 | class ExecModel(metaclass=abc.ABCMeta): |
@@ -973,9 +962,9 @@ def reconfigure( |
973 | 962 |
|
974 | 963 | class ChannelFactory: |
975 | 964 | def __init__(self, gateway: BaseGateway, startcount: int = 1) -> None: |
976 | | - self._channels: weakref.WeakValueDictionary[ |
977 | | - int, Channel |
978 | | - ] = weakref.WeakValueDictionary() |
| 965 | + self._channels: weakref.WeakValueDictionary[int, Channel] = ( |
| 966 | + weakref.WeakValueDictionary() |
| 967 | + ) |
979 | 968 | # Channel ID => (callback, end marker, strconfig) |
980 | 969 | self._callbacks: dict[ |
981 | 970 | int, tuple[Callable[[Any], Any], object, tuple[bool, bool]] |
|
0 commit comments