File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
lagrange/utils/binary/protobuf Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ def check_type(value: Any, typ: Any) -> bool:
164164 return check_type (value , get_args (typ )[0 ]) if value is not None else True
165165 if isinstance (value , typ ):
166166 return True
167- return False # or True if value is None else False
167+ return True if value is None else False # proto3 std
168168
169169
170170_unevaluated_classes : set [type ["ProtoStruct" ]] = set ()
@@ -255,7 +255,7 @@ def __repr__(self) -> str:
255255 if k .startswith ("_" ):
256256 continue
257257 attrs += f"{ k } ={ v !r} , "
258- return f"{ self .__class__ .__name__ } ({ attrs } )"
258+ return f"{ self .__class__ .__name__ } ({ attrs [: - 2 ] } )"
259259
260260 def encode (self ) -> bytes :
261261 pb_dict : NT = {}
@@ -289,7 +289,7 @@ def decode(cls, data: bytes) -> Self:
289289 }
290290
291291 if pb_dict and cls .__proto_debug__ : # unhandled tags
292- pass
292+ print ( f"DEBUG: unhandled tags ' { pb_dict } ' on { cls } " )
293293 return cls (True , ** kwargs )
294294
295295
You can’t perform that action at this time.
0 commit comments