Thanks a lot for the reply. I'll read the match algorithm later. But for the script you gave, it seems that in my version of sympy, there's no function called "as_Add()". I am using sympy 0.6.7. Are you using a higher version of sympy?
Chenjie On Sat, Oct 23, 2010 at 1:06 AM, smichr <smi...@gmail.com> wrote: > ...and if you only want terms that acutally have x then also use the > method .has(): > > > h[1] >>> [a for a in (1+x).as_Add() if a.is_polynomial(x)] > [1, x] > h[2] >>> [a for a in (1+x).as_Add() if a.has(x) and > a.is_polynomial(x)] > [x] > h[3] >>> > > > > > > > /c > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sy...@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com <sympy%2bunsubscr...@googlegroups.com>. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sy...@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.