Is this a bug? FiniteSetMaps??
These are two empty maps with two essentially equal parents:
f = FiniteSetMaps(set()).from_dict({})
g = FiniteSetMaps(set(),set()).from_dict({})
f == g
False
These are two empty maps with two essentially equal parents:
f = FiniteSetMaps(set()).from_dict({})
g = FiniteSetMaps(set(),set()).from_dict({})
f == g
False
They have different hashes
sage: f._hash_()
115435715
sage: g._hash_()
115435971
Also:
sage: f.parent()
Maps from {} to itself
sage: g.parent()
Maps from {} to {}
sage: type(f.parent())
<class 'sage.sets.finite_set_maps.FiniteSetEndoMaps_Set_with_category'>
sage: type(g.parent())
<class 'sage.sets.finite_set_maps.FiniteSetMaps_Set_with_category'>
Programmatically, they probably can not be considered the same if the parents are different. Without looking at the actual source code, I presume that the computation of the hash will be different in the two different classes.
Yes, I guess we have to live with this. Technically if the maps are the same with the same codomain and domain, then they should have the same parent, and because the parent is defined when the maps are created I see how this could be a problem to fix since we can't change parents once the object is created, right?
Asked: 12 years ago
Seen: 242 times
Last updated: Nov 28 '12