Hello,
I play with expressions, and transform sin(x) to (exp(i*x)-exp(-i*x))/2.
So I use a lot of test as
var ('x')
y = cos(x) # or any other expression"
op = y.operator # so op == cos
if op == cos : ... # this test is fine, not the next one
else : ...
Now I want to test an expression with the binomial function call.
y = binomial (3*x, x) # is fine
op = y.operator() # is also fine
op # I get binomial
op == binomial # remains False
Type(s) are differents for binomial but are the sames for sin :
type (op), type(binomial) # type are differents
<class 'sage.functions.other.Function_binomial'>, <type 'function'>
sage: type(sin(x).operator()), type(sin)
(<class 'sage.functions.trig.Function_sin'>, <class
'sage.functions.trig.Function_sin'>)
How can I do this test for binomial ?
I don't want to use match and SR.wild(n) because I can't insert inside
the match.
Do you have any idea ?
Many thanks.
F.
--
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