https://docs.python.org/3/library/stdtypes.html
"if concatenating bytes objects, you can similarly use bytes.join() or io.BytesIO, or you can do in-place concatenation with a bytearray object. bytearray objects are mutable and have an efficient overallocation mechanism"
Type: improvement
Signed-off-by: Viktor Velichkin <avisom@yandex.ru>
Change-Id: Id20d337f909cce83fcd9e08e8049bb0bf5970fbc
for e in list:
b += self.packer.pack(e)
for e in list:
b += self.packer.pack(e)
def unpack(self, data, offset=0, result=None, ntc=False):
# Return a list of arguments
def unpack(self, data, offset=0, result=None, ntc=False):
# Return a list of arguments
return b"".join(lst)
return bytes(lst)
return b"".join(lst)
return bytes(lst)
for e in lst:
b += self.packer.pack(e)
for e in lst:
b += self.packer.pack(e)
def unpack(self, data, offset=0, result=None, ntc=False):
# Return a list of arguments
def unpack(self, data, offset=0, result=None, ntc=False):
# Return a list of arguments
if self.packer.size == 1:
return bytes(list)
if self.packer.size == 1:
return bytes(list)
for e in list:
b += self.packer.pack(e)
for e in list:
b += self.packer.pack(e)
def unpack(self, data, offset=0, result=None, ntc=False):
total = 0
def unpack(self, data, offset=0, result=None, ntc=False):
total = 0
def pack(self, data, kwargs=None):
if not kwargs:
kwargs = data
def pack(self, data, kwargs=None):
if not kwargs:
kwargs = data
# Try one of the format functions
if data and conversion_required(data, self.name):
# Try one of the format functions
if data and conversion_required(data, self.name):
else:
b += self.packers[i].pack(arg, kwargs)
else:
b += self.packers[i].pack(arg, kwargs)
def unpack(self, data, offset=0, result=None, ntc=False):
# Return a list of arguments
def unpack(self, data, offset=0, result=None, ntc=False):
# Return a list of arguments