'Test if a Cookies object is globally \'equal\' to another one by
seeing if it looks like a dict such that d[k] == self[k]. This depends
on each Cookie object reporting its equality correctly.'

def __eq__(self, other):

    if (not hasattr(other, 'keys')):
        return False
    try:
        keys = sorted((set(self.keys()) | set(other.keys())))
        for key in keys:
            if (not (key in self)):
                return False
            if (not (key in other)):
                return False
            if (not (self[key] == other[key])):
                return False
    except (TypeError, KeyError):
        raise
    return True
