'Returns a new Diff object of a specific subclass from an existing diff
object, passing on the values for any arguments they share in common
(such as ignore_keywords).
For example::
>>> from astropy.io import fits
>>> hdul1, hdul2 = fits.HDUList(), fits.HDUList()
>>> headera, headerb = fits.Header(), fits.Header()
>>> fd = fits.FITSDiff(hdul1, hdul2, ignore_keywords=[\'*\'])
>>> hd = fits.HeaderDiff.fromdiff(fd, headera, headerb)
>>> list(hd.ignore_keywords)'

@classmethod
def fromdiff(cls, other, a, b):

    sig = signature(cls.__init__)
    kwargs = {}
    for arg in list(sig.parameters.keys())[3:]:
        if hasattr(other, arg):
            kwargs[arg] = getattr(other, arg)
    return cls(a, b, **kwargs)
