docs: def getrange(self):
          """Retrieve the dataset min and max values.
  
          Args::
  
            no argument
  
          Returns::
  
            (min, max) tuple (attribute 'valid_range')
  
            Note that those are the values as stored
            by the 'setrange' method. 'getrange' does *NOT* compute the
            min and max from the current dataset contents.
  
          An exception is raised if the range is not set.
  
          The range returned by 'getrange' is part of the so-called
          "standard" SDS attributes. It corresponds to the following
          attribute::
  
            valid_range
  
          C library equivalent: SDgetrange
                                                         """
  
          # Obtain SDS data type.
          try:
              sds_name, rank, dim_sizes, data_type, n_attrs = \
                                 self.info()
          except HDF4Error:
              raise HDF4Error('getrange : invalid SDS identifier')
          n_values = 1
  
          convert = _array_to_ret
          if data_type == SDC.CHAR8:
              buf1 = _C.array_byte(n_values)
              buf2 = _C.array_byte(n_values)
              convert = _array_to_str
  
          elif data_type in  [SDC.UCHAR8, SDC.UINT8]:
              buf1 = _C.array_byte(n_values)
              buf2 = _C.array_byte(n_values)
  
          elif data_type == SDC.INT8:
              buf1 = _C.array_int8(n_values)
              buf2 = _C.array_int8(n_values)
  
          elif data_type == SDC.INT16:
              buf1 = _C.array_int16(n_values)
              buf2 = _C.array_int16(n_values)
  
          elif data_type == SDC.UINT16:
              buf1 = _C.array_uint16(n_values)
              buf2 = _C.array_uint16(n_values)
  
          elif data_type == SDC.INT32:
              buf1 = _C.array_int32(n_values)
              buf2 = _C.array_int32(n_values)
  
          elif data_type == SDC.UINT32:
              buf1 = _C.array_uint32(n_values)
              buf2 = _C.array_uint32(n_values)
  
          elif data_type == SDC.FLOAT32:
              buf1 = _C.array_float32(n_values)
              buf2 = _C.array_float32(n_values)
  
          elif data_type == SDC.FLOAT64:
              buf1 = _C.array_float64(n_values)
              buf2 = _C.array_float64(n_values)
  
          else:
              raise HDF4Error("getrange: SDS has an illegal or " \
                               "unsupported type %d" % data)
  
          # Note: The C routine returns the max in buf1 and the min
          # in buf2. We swap the values returned by the Python
          # interface, since it is more natural to return
          # min first, then max.
          status = _C.SDgetrange(self._id, buf1, buf2)
          _checkErr('getrange', status, 'range not set')
          return convert(buf2, n_values), convert(buf1, n_values)