@mrocklin : This immutable solution seems better. I will implement it in the next commit.

> Immutability is sometimes slow. There are often ways around this slowness. Often by working your way around it you make your code cleaner. In general immutability results in objects that are much easier to work with and automatically reason about. Much of the power of SymPy depends on the immutable assumption. If you need to remain immutable then most of SymPy will not be able to interoperate with this code. That would be a great loss.

I think you meant `mutable` in the last line of your comment. Actually, before this PR, I didn't know that Sympy depends on the immutable assumption and mutability hence could be an issue. Thanks for explaining me out. I will implement the immutable solution.