for symbol, coefficient in coefficients:
if not isinstance(symbol, Symbol):
raise TypeError('symbols must be Symbol instances')
if not isinstance(coefficient, numbers.Rational):
raise TypeError('coefficients must be rational numbers')
for symbol, coefficient in coefficients:
if not isinstance(symbol, Symbol):
raise TypeError('symbols must be Symbol instances')
if not isinstance(coefficient, numbers.Rational):
raise TypeError('coefficients must be rational numbers')