sympy/sympy — pull request #1093 by smichr (2012-02-29 19:10:26+00:00)
Title: 2558: coeff(x, e) selects coeff of x**e

e defaults to 1; the constant in an Add is only
selected if e == 0

>>> (x + 2*y + 3).coeff(1)
x
>>> (x + 2*y + 3).coeff(x, 0)
3
>>> (x + 2*y + 3).coeff(0, 0)
3
>>> (x + 2*y + 3).coeff(y, 1)
2