Comment #1 on issue 2558 by [email protected]: coeff() should allow x**0
(constant coefficients)
http://code.google.com/p/sympy/issues/detail?id=2558
If you convert the expr to a Poly then there are methods for this:
>>> p
Poly(3*x**3 + x**2 + 1, x, domain='ZZ')
>>> p.degree()
3
>>> p.all_coeffs()
[3, 1, 0, 1]
Alternatively, you can use `expr.as_coeff_Add()` to get the additive Number
to an expression once https://github.com/sympy/sympy/pull/430 is processed.
But I see the sense in the syntax you cite since then you can easily loop
through the coefficients like `[eq.coeff(x, n) for n in range(3)]`. I think
n should default to 1.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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-issues?hl=en.