...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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
