@@ -611,11 +611,13 @@ class _DecodeUtils:
611611 INT64_BYTE_FORMAT = "!q"
612612
613613 # uint byte size to unpack format
614- UINT_BYTE_FORMAT : Mapping [_ArraySize , str ] = MappingProxyType ({
615- 1 : UINT8_BYTE_FORMAT ,
616- 2 : UINT16_BYTE_FORMAT ,
617- 4 : UINT32_BYTE_FORMAT ,
618- })
614+ UINT_BYTE_FORMAT : Mapping [_ArraySize , str ] = MappingProxyType (
615+ {
616+ 1 : UINT8_BYTE_FORMAT ,
617+ 2 : UINT16_BYTE_FORMAT ,
618+ 4 : UINT32_BYTE_FORMAT ,
619+ }
620+ )
619621
620622 @staticmethod
621623 def unpack_uint8 (data : BytesLike ) -> tuple [int , int ]:
@@ -750,20 +752,24 @@ class EventHeaderDecoder(Iterator[tuple[str, HEADER_VALUE]]):
750752
751753 # Maps header type to appropriate unpacking function
752754 # These unpacking functions return the value and the amount unpacked
753- _HEADER_TYPE_MAP : Mapping [int , Callable [[BytesLike ], tuple [HEADER_VALUE , int ]]] = MappingProxyType ({
754- # Boolean headers have no data bytes following the type signifier, so they
755- # can just return static values.
756- 0 : lambda b : (True , 0 ), # boolean_true
757- 1 : lambda b : (False , 0 ), # boolean_false
758- 2 : _DecodeUtils .unpack_int8 , # byte
759- 3 : _DecodeUtils .unpack_int16 , # short
760- 4 : _DecodeUtils .unpack_int32 , # integer
761- 5 : _DecodeUtils .unpack_int64 , # long
762- 6 : _DecodeUtils .unpack_byte_array , # byte_array
763- 7 : _DecodeUtils .unpack_utf8_string , # string
764- 8 : _DecodeUtils .unpack_timestamp , # timestamp
765- 9 : _DecodeUtils .unpack_uuid , # uuid
766- })
755+ _HEADER_TYPE_MAP : Mapping [int , Callable [[BytesLike ], tuple [HEADER_VALUE , int ]]] = (
756+ MappingProxyType (
757+ {
758+ # Boolean headers have no data bytes following the type signifier, so they
759+ # can just return static values.
760+ 0 : lambda b : (True , 0 ), # boolean_true
761+ 1 : lambda b : (False , 0 ), # boolean_false
762+ 2 : _DecodeUtils .unpack_int8 , # byte
763+ 3 : _DecodeUtils .unpack_int16 , # short
764+ 4 : _DecodeUtils .unpack_int32 , # integer
765+ 5 : _DecodeUtils .unpack_int64 , # long
766+ 6 : _DecodeUtils .unpack_byte_array , # byte_array
767+ 7 : _DecodeUtils .unpack_utf8_string , # string
768+ 8 : _DecodeUtils .unpack_timestamp , # timestamp
769+ 9 : _DecodeUtils .unpack_uuid , # uuid
770+ }
771+ )
772+ )
767773
768774 def __init__ (self , header_bytes : BytesLike ) -> None :
769775 """Initialize an event header decoder.
0 commit comments