#9940: Fix equality/inequality for AdditiveAbelianGroup
-----------------------------+----------------------------------------------
   Reporter:  mpatel         |       Owner:  joyner    
       Type:  defect         |      Status:  needs_work
   Priority:  critical       |   Milestone:  sage-4.6.1
  Component:  group theory   |    Keywords:            
     Author:  John Palmieri  |    Upstream:  N/A       
   Reviewer:                 |      Merged:            
Work_issues:                 |  
-----------------------------+----------------------------------------------
Changes (by jhpalmieri):

  * status:  needs_review => needs_work


Comment:

 Replying to [comment:11 mpatel]:
 > It seems the only other class that derives [directly] from
 `FGP_Module_class` is `sage.geometry.toric_lattice.ToricLattice_quotient`,
 which also doesn't define its own `__eq__` and `__ne__`:
 {{{
 #!python
 sage: N1 = ToricLattice(3)
 sage: sublattice1 = N1.submodule([(1,1,0), (3,2,1)])
 sage: Q1 = N1/sublattice1
 sage: N2 = ToricLattice(3)
 sage: sublattice2 = N2.submodule([(1,1,0), (3,2,1)])
 sage: Q2 = N2/sublattice2
 sage: Q1 == Q2
 True
 sage: Q1 != Q2
 True
 }}}
 > Is this expected?

 I think what I find the most confusing is that comparisons work well for
 finitely generated free modules, but not for the derived classes.  If they
 behaved badly in all cases, I would know how to fix it, and while adding a
 {{{__ne__}}} method for `FGP_Module_class` (and perhaps `__lt__` and
 `__gt__` methods, although I'm not sure what they should return: I suppose
 `self.is_submodule(other) and self != other`) would probably make the
 comparisons work, I still wouldn't understand why that was the right place
 to do it.

 So one question is, is the right thing to do to add methods `__ne__`,
 `__lt__`, and `__gt__`, and perhaps `__ge__` and `__le__`, to
 `FGP_Module_class`?

 I'm marking this as "needs work", because we should address comparisons
 like `H<G` at the same time as `H!=G`.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9940#comment:12>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to