`if any(not j.is_Integer for j in a):`.  Note, you should use `is_Integer`, not `is_integer`. The lowercase version checks the assumptions, the uppercase version checks the class. For example, `Symbol('x', integer=True).is_integer` is True, but `Symbol('x', integer=True).is_Integer` is False.