File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class GeneralFrame:
11
11
header : t .CommandHeader
12
12
data : t .Bytes
13
13
14
- def __post_init__ (self ):
14
+ def __post_init__ (self ) -> None :
15
15
# We're frozen so `self.header = ...` is disallowed
16
16
if not isinstance (self .header , t .CommandHeader ):
17
17
object .__setattr__ (self , "header" , t .CommandHeader (self .header ))
Original file line number Diff line number Diff line change 3
3
_TRACE = 5
4
4
5
5
6
- def _find_trace_level ():
6
+ def _find_trace_level () -> int :
7
7
if logging .getLevelName (_TRACE ) != f"Level { _TRACE } " :
8
8
# If a level 5 exists, use it
9
9
return _TRACE
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def real_cls(cls) -> type:
18
18
return next (c for c in cls .__mro__ if c .__name__ != "Optional" )
19
19
20
20
@classmethod
21
- def _annotations (cls ) -> typing .List [ type ]:
21
+ def _annotations (cls ) -> typing .Dict [ str , typing . Any ]:
22
22
# First get our proper subclasses
23
23
subclasses = []
24
24
@@ -195,7 +195,7 @@ def serialize(self) -> bytes:
195
195
)
196
196
197
197
@classmethod
198
- def deserialize (cls , data : bytes ) -> "Struct" :
198
+ def deserialize (cls , data : bytes ) -> typing . Tuple [ "Struct" , bytes ] :
199
199
instance = cls ()
200
200
201
201
for field in cls .fields ():
@@ -239,7 +239,7 @@ class StructField:
239
239
dynamic_type : typing .Optional [typing .Callable [[Struct ], type ]] = None
240
240
requires : typing .Optional [typing .Callable [[Struct ], bool ]] = None
241
241
242
- def __post_init__ (self ):
242
+ def __post_init__ (self ) -> None :
243
243
# Fail to initialize if the concrete type is invalid
244
244
if self .dynamic_type is None :
245
245
self .concrete_type
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ def _extract_frame(self) -> frames.TransportFrame:
140
140
141
141
return frame
142
142
143
- def __repr__ (self ):
143
+ def __repr__ (self ) -> str :
144
144
return f"<{ type (self ).__name__ } for { self ._api } >"
145
145
146
146
You can’t perform that action at this time.
0 commit comments