'Summarize the HDU: name, dimensions, and formats.'

def _summary(self):

    class_name = self.__class__.__name__
    if self._data_loaded:
        if (self.data is None):
            (shape, format) = ((), '')
            nrows = 0
        else:
            nrows = len(self.data)
        ncols = len(self.columns)
        format = self.columns.formats
    else:
        shape = ()
        nrows = self._header['NAXIS2']
        ncols = self._header['TFIELDS']
        format = ',    '.join([self._header[('TFORM' + str((j + 1)))] for j in range(ncols)])
        format = '[{}]'.format(format)
    dims = '{}R    x    {}C'.format(nrows, ncols)
    ncards = len(self._header)
    return (self.name, self.ver, class_name, ncards, dims, format)
