Ask Your Question

Is this a bug? FiniteSetMaps??

asked 2012-11-26 17:20:43 +0200

SLOtoSF gravatar image

These are two empty maps with two essentially equal parents:

f = FiniteSetMaps(set()).from_dict({})
g = FiniteSetMaps(set(),set()).from_dict({})
f == g

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-28 12:52:36 +0200

ppurka gravatar image

updated 2012-11-28 12:55:18 +0200

They have different hashes

sage: f._hash_()
sage: g._hash_()


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'>
edit flag offensive delete link more


@ppurka I see that the parents are different and that they have different hashes, but ultimately they function the same, so shouldn't they be considered equal?

SLOtoSF gravatar imageSLOtoSF ( 2012-11-28 14:03:00 +0200 )edit

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.

ppurka gravatar imageppurka ( 2012-11-29 10:08:29 +0200 )edit

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?

SLOtoSF gravatar imageSLOtoSF ( 2012-11-30 20:13:21 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-11-26 17:20:43 +0200

Seen: 210 times

Last updated: Nov 28 '12