Ask Your Question

Is this a bug? FiniteSetMaps??

asked 2012-11-26 10:20:43 -0500

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 05:52:36 -0500

ppurka gravatar image

updated 2012-11-28 05:55:18 -0500

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 07:03:00 -0500 )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 03:08:29 -0500 )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 13:13:21 -0500 )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 10:20:43 -0500

Seen: 64 times

Last updated: Nov 28 '12