'Determine if any changes to the HDUList will require a file resize
when flushing the file.
Side effect of setting the objects _resize attribute.'

def _wasresized(self, verbose=False):

    if (not self._resize):
        for hdu in self:
            nbytes = len(str(hdu._header))
            if (nbytes != (hdu._data_offset - hdu._header_offset)):
                self._resize = True
                self._truncate = False
                if verbose:
                    print('One    or    more    header    is    resized.')
                break
            if (not hdu._has_data):
                continue
            nbytes = hdu.size
            nbytes = (nbytes + _pad_length(nbytes))
            if (nbytes != hdu._data_size):
                self._resize = True
                self._truncate = False
                if verbose:
                    print('One    or    more    data    area    is    resized.')
                break
        if self._truncate:
            try:
                self._file.truncate((hdu._data_offset + hdu._data_size))
            except IOError:
                self._resize = True
            self._truncate = False
    return self._resize
