On 24/09/15 03:47, Ralf Stephan wrote:

   ex.is_zero(simplify=False)
   ex.is_zero(simplify=True)

This fits if ex is an equality. But what about: if x>0 ?
Two functions are necessary for inequalities because (x>0).__nonzero__
is called by (x>0)._cmp_ in case of eg. uniq(list of exes) and
here print or alphabetical order is called for, not proof.

So there is still a need for hold/truth() etc it seems.

I like the is_zero which is consistent with the rest of Sage (ie sage.structure.element.Element). But note that the default implementation there is

def is_zero(self):
    return not self

def __nonzero__(self):
    return self != self._parent.zero()

I think that if a relation is fed into such a test it should have break earlier if it was not expected. Note that in a context related to your initial problem, this works

sage: matrix([x==3])
[x == 3]

Should it?


I do not like hold since it is already used as a keyword everywhere in symbolics

sage: cos(pi, hold=True)
cos(pi)

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to