'Summarize the info of the HDUs in this `HDUList`.
Note that this function prints its results to the console---it
does not return a value.
Parameters
output : file, bool, optional
A file-like object to write the output to.  If `False`, does not
output to a file and instead returns a list of tuples representing
the HDU info.  Writes to ``sys.stdout`` by default.'

def info(self, output=None):

    if (output is None):
        output = sys.stdout
    if (self._file is None):
        name = '(No    file    associated    with    this    HDUList)'
    else:
        name = self._file.name
    results = ['Filename:    {}'.format(name), 'No.                Name                        Ver                Type                        Cards            Dimensions            Format']
    format = '{:3d}        {:10}        {:3}    {:11}        {:5d}            {}            {}            {}'
    default = ('', '', '', 0, (), '', '')
    for (idx, hdu) in enumerate(self):
        summary = hdu._summary()
        if (len(summary) < len(default)):
            summary += default[len(summary):]
        summary = ((idx,) + summary)
        if output:
            results.append(format.format(*summary))
        else:
            results.append(summary)
    if output:
        output.write('\n'.join(results))
        output.write('\n')
        output.flush()
    else:
        return results[2:]
