Hi Simon,

On Mon, 25 Oct 2010 05:09:06 -0700 (PDT)
Simon King <[email protected]> wrote:
 
> I only opened one ticket, namely #10169, aiming at making
> s==s.operator()(*s.operands()) work uniformely.

I don't think this makes sense for variables, numeric objects, or
constants, in other words, objects for which .operator() returns None
at the moment.

If we return an identity operator for these cases, how do you plan to
test for it in your code:

sage: def symround(x, ndigits=0):
....:     if hasattr(x,'operator') and x.operator():
....:         return x.operator()(*map(lambda
y:symround(y,ndigits=ndigits), x.operands()))
....:     try:
....:         return round(x,ndigits=ndigits)
....:     except TypeError:
....:         return x
....:


Isn't it simpler (and faster) to check for None?


Cheers,
Burcin

-- 
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-support
URL: http://www.sagemath.org

Reply via email to