Hi there,

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.

 3 - .zero() and .one() must never be mutable. I'd like to enforce this by
     computing .__hash__(). Here I see two possibilities:
        * decide that for any monoid M, if M.one() implement __hash__ it must
          returns an int (not an Integer) and not raise an exception like in
          sage: m = matrix([1]).__hash__()
          ...
          TypeError: mutable matrices are unhashable

        * decide that any element of a monoid must be hashable.

     Do you think this is asking too much ?

By the way, if you have ideas of other basic sanity checks which must be added
please tell me.

Cheers,

Florent, back from Sage days 20.

PS: Sage days 20 were extremely fun and enjoyable ! Though we worked quite
hard (I typically went to bed at 3 and woke up at 8), we haven't been
producing that much code but I think we recruited a *lot* of new users among
which there may be many developers. A progress report is being written and
should be posted very soon. I need some rest now :-)

-- 
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