'Equality comparision for XPCOM'

def equals(self, other):

    if _xpcom_:
        try:
            other = UnwrapObject(other)
        except:
            pass
    for attr in ('lang', 'path', 'blobname', 'lpath', 'name', 'line', 'ilk', 'citdl', 'doc', 'signature', 'attributes', 'returns'):
        if (getattr(self, attr) != getattr(other, attr)):
            return False
    return True
