'Return the file name associated with the HDUList object if one exists.
Otherwise returns None.
Returns
filename : a string containing the file name associated with the
HDUList object if an association exists.  Otherwise returns
None.'

def filename(self):

    if (self._file is not None):
        if hasattr(self._file, 'name'):
            return self._file.name
    return None
