On Feb 27, 2010, at 3:14 AM, Florent Hivert wrote:

     Hi Robert,

In order to sanitize the behavior of objects, parents and elements in
sage,
I'm about to add some tests to the framework. I think they are all
reasonable
but I may be asking to much. Please comment about the following:

1 - Any SageObject must have an equality methods such that
    self == self and self != None

2 - Element construction should be idempotent. More precisely, for any
   element e within parent P, the equality P(e) == e must hold.
This is for example needed by the constructor of many Parent with a
base
   ring, such as matrices.

Elements of real interval fields don't satisfy the above two constraints (the notion of equality for intervals being that every element of the first
interval is equal to every element in the second).

You get the point. As far as I understand a RIF only return True if the interval are reduced to a single point. Is it right ? It would be better to return a special value like Unknown than False. But that's another question...

Anyway, I'm strongly info favor of giving 1- and 2- a general rule with an
explicit exception for RIF. As I said, the test framework allows such
exceptions. Is there an agreement on

* Making 1- and 2- below a general rule

1 - Any SageObject must have an equality methods such that
    self == self and self != None

2 - Element construction should be idempotent. More precisely, for any
   element e within parent P, the equality P(e) == e must hold.

 * Making explicit exception for particular cases such as RIF.

I certainly agree that 1-2 should be the general rule, I was just pointing out an exception. I like the idea of returning an Unknown object on RIF comparisons as well.

- Robert

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to