sympy/sympy — pull request #7556 by flacjacket (2014-06-03 00:22:35+00:00)
Title: Fix `Basic.rewrite()` behavior

Fixes the behavior of `Basic.rewrite` to call the opropriate rule function. Furthermore, added handling for `deep` keyword to `Basic.rewrite()`, which defaults to `True`. This change allows the removal of `Function.rewrite()` and `physics.quantum.QExpr.rewrite()` methods, however, the default behavior is changed from `deep=False` to `deep=True`.