code: def packrealsize(*properties):
      '''
      Revert to sizefromlen, pack the struct real size (struct._realsize()) to specified property path.
      Unlike packsize, the size without padding is stored. Often used in nstruct "prepack" parameter.
      
      :param properties: specified field name, same as sizefromlen.
      
      :returns: a function which takes a NamedStruct as parameter, and pack the size to specified field.
      
      '''
      def func(namedstruct):
          v = namedstruct._target
          for p in properties[:-1]:
              v = getattr(v, p)
          setattr(v, properties[-1], namedstruct._realsize())
      return funf packrealsize(*properties):
      '''
      Revert to sizefromlen, pack the struct real size (struct._realsize()) to specified property path.
      Unlike packsize, the size without padding is stored. Often used in nstruct "prepack" parameter.
      
      :param properties: specified field name, same as sizefromlen.
      
      :returns: a function which takes a NamedStruct as parameter, and pack the size to specified field.
      
      '''
      def func(namedstruct):
          v = namedstruct._target
          for p in properties[:-1]:
              v = getattr(v, p)
          setattr(v, properties[-1], namedstruct._realsize())
      return func
docs: Revert to sizefromlen, pack the struct real size (struct._realsize()) to specified property path.
      Unlike packsize, the size without padding is stored. Often used in nstruct "prepack" parameter.
      
      :param properties: specified field name, same as sizefromlen.
      
      :returns: a function which takes a NamedStruct as parameter, and pack the size to specified field.