'Returns `True` if ``HDUList.index_of(item)`` succeeds.'

def __contains__(self, item):

    try:
        self._try_while_unread_hdus(self.index_of, item)
    except KeyError:
        return False
    return True
