sympy/sympy — pull request #1134 by smichr (2012-03-18 01:30:16+00:00)
Title: 3099: try to speed up is_constant

- try substitution before evaluation - if different Rationals are obtained
then False can be returned.

- try evaluation with real before complex in is_constant

It's still possible for is_constant to be slow but this helps it move a little faster in some cases.