docs: def unpack(self, data, namedstruct):
          '''
          Unpack the struct from specified bytes. If the struct is sub-classed, definitions from the sub type
          is not unpacked.
          
          :param data: bytes of the struct, including fields of sub type and "extra" data.
          
          :param namedstruct: a NamedStruct object of this type
          
          :returns: unused bytes from data, which forms data of the sub type and "extra" data. 
          '''
          try:
              result = self.struct.unpack(data[0:self.struct.size])
          except struct.error as exc:
              raise BadFormatError(exc)
          start = 0
          t = namedstruct._target
          for p in self.properties:
              if len(p) > 1:
                  if isinstance(result[start], bytes):
                      v = [r.rstrip(b'\x00') for r in result[start:start + p[1]]]
                  else:
                      v = list(result[start:start + p[1]])
                  start += p[1]
              else:
                  v = result[start]
                  if isinstance(v, bytes):
                      v = v.rstrip(b'\x00')
                  start += 1
              setin = t
              for sp in p[0][0:-1]:
                  if not hasattr(setin, sp):
                      setin2 = InlineStruct(namedstruct._target)
                      setattr(setin, sp, setin2)
                      setin = setin2
                  else:
                      setin = getattr(setin, sp)
              setattr(setin, p[0][-1], v)
          return data[self.struct.size:]