docs: def standard_dm_read(datatype_num, desc):
      """
      datatype_num is the number of the data type, see dm_simple_names
      above. desc is a (nicename, struct_char) tuple. We return a function
      that parses the data for us.
      """
      nicename, structchar, types = desc
  
      def dm_read_x(f, outdata=None):
          """Reads (or write if outdata is given) a simple data type.
          returns the data if reading and the number of bytes of header
          """
          if outdata is not None:  # this means we're WRITING to the file
              if verbose:
                  print("dm_write start", structchar, outdata, "at", f.tell())
              put_into_file(f, "<" + structchar, outdata)
              if verbose:
                  print("dm_write end", f.tell())
              return 0
          else:
              if verbose:
                  print("dm_read start", structchar, "at", f.tell())
              result = get_from_file(f, "<" + structchar)
              if verbose:
                  print("dm_read end", f.tell())
              return result, 0
  
      return dm_read_x