Use the shortened version of `isinstance`. Replaced
`isinstance(eq, Add) or isinstance(eq, Mull) or ....` by
`isinstance(eq, (Add, Mul, ...))

Replaced the search for `None` using a for loop by using
`in`.