Ask Your Question
0

Is this a bug? FiniteSetMaps??

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

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

False
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

ppurka gravatar image

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

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

Comments

@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 +0100 )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 +0100 )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 +0100 )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

Stats

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

Seen: 228 times

Last updated: Nov 28 '12