docs: def set(self, data_type, values):
          """Update/Create a new attribute and set its value(s).
  
          Args::
  
            data_type    : attribute data type (see constants SDC.xxx)
            values       : attribute value(s); specify a list to create
                           a multi-valued attribute; a string valued
                           attribute can be created by setting 'data_type'
                           to SDC.CHAR8 and 'values' to the corresponding
                           string
  
          Returns::
  
            None
  
          C library equivalent : SDsetattr
  
          Attributes can also be written like ordinary python attributes,
          using the dot notation. See "High level attribute access".
  
                                                    """
          try:
              n_values = len(values)
          except:
              n_values = 1
              values = [values]
          if data_type == SDC.CHAR8:
              buf = _C.array_byte(n_values)
              # Allow values to be passed as a string.
              # Noop if a list is passed.
              values = list(values)
              for n in range(n_values):
                  values[n] = ord(values[n])
  
          elif data_type in [SDC.UCHAR8, SDC.UINT8]:
              buf = _C.array_byte(n_values)
  
          elif data_type == SDC.INT8:
              buf = _C.array_int8(n_values)
  
          elif data_type == SDC.INT16:
              buf = _C.array_int16(n_values)
  
          elif data_type == SDC.UINT16:
              buf = _C.array_uint16(n_values)
  
          elif data_type == SDC.INT32:
              buf = _C.array_int32(n_values)
  
          elif data_type == SDC.UINT32:
              buf = _C.array_uint32(n_values)
  
          elif data_type == SDC.FLOAT32:
              buf = _C.array_float32(n_values)
  
          elif data_type == SDC.FLOAT64:
              buf = _C.array_float64(n_values)
  
          else:
              raise HDF4Error("set: illegal or unimplemented data_type")
  
          for n in range(n_values):
              buf[n] = values[n]
          status = _C.SDsetattr(self._obj._id, self._name,
                                data_type, n_values, buf)
          _checkErr('set', status, 'illegal attribute')
          # Init index following attribute creation.
          self._index = _C.SDfindattr(self._obj._id, self._name)
          _checkErr('find', self._index, 'illegal attribute')