#8402: Sanity check for Parents and Elements
------------------------------+---------------------------------------------
   Reporter:  hivert          |       Owner:  hivert                            
  
       Type:  defect          |      Status:  new                               
  
   Priority:  major           |   Milestone:  sage-4.4                          
  
  Component:  categories      |    Keywords:  Parent, Element, equality, zero, 
one
     Author:  Florent Hivert  |    Upstream:  N/A                               
  
   Reviewer:                  |      Merged:                                    
  
Work_issues:                  |  
------------------------------+---------------------------------------------

Old description:

> Here is the summary of what was decided on
> [http://groups.google.com/group/sage-devel/t/5d9c32390ffe3c96
> sage=devel]:
>
> 1 - Any Parent or Element must have an equality methods such that
> {{{self == self}}} and {{{self != None}}}. This is not required for
> general {{{SageObject}}}.
>
> 2 - Element construction should be idempotent. More precisely, for any
> element e within parent P, the equality {{{P(e) == e}}} must hold.
>
> Case by case exception such as {{{RealIntervalField}}} are possible.
>
> 3 - element of a parent in the category {{{Monoid()}}} (respectively
> {{{CommutativeAdditiveMonoid()}}}) must have a {{{__hash__}}} method,
> which may raise an error for mutable element but never on {{{.one()}}}
> (respectively {{{.zero()}}})

New description:

 Here is the summary of what was decided on [http://groups.google.com/group
 /sage-devel/t/5d9c32390ffe3c96 sage=devel]:

 1 - Any Parent or Element must have an equality methods such that
 {{{self == self}}} and {{{self != None}}}. This is not required for
 general {{{SageObject}}}. I also test that {{{self != self}}} and {{{self
 == None}}} both returns {{{False}}}.

 2 - Element construction should be idempotent. More precisely, for any
 element e within parent P, the equality {{{P(e) == e}}} must hold. This
 should only be enforced for true parent since it cause some problems for
 facade parents.

 Case by case exception such as {{{RealIntervalField}}} are possible.

 3 - {{{_test_hash}}}: test that the result of hash is an int or that it
 raises an appropriate exception

 3' - element of a parent in the category {{{Monoid()}}} (respectively
 {{{CommutativeAdditiveMonoid()}}}) must have a {{{__hash__}}} method,
 which may raise an error for mutable element but never on {{{.one()}}}
 (respectively {{{.zero()}}})

--

Comment(by hivert):

 I'm preparing some patches on sage-combinat queue. I already caught some
 bug with it: see #8695.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8402#comment:2>
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