def _not_a_coeff(expr):
 return (expr in [S.NaN, S.Infinity, S.NegativeInfinity, S.ComplexInfinity])

def _not_a_coeff ( expr ) : return ( expr in [ S . NaN , S . Infinity , S . NegativeInfinity , S . ComplexInfinity ] )
do not treat nan and infinities as valid polynomial coefficients .