sympy/sympy — pull request #1431 by asmeurer (2012-07-19 05:00:18+00:00)
Title: Expand refactor

OK, here it comes...

See the commit message of e716d20 for the description of the bulk of the changes here, and the motivation for all the changes.

This is **not** ready to be merged yet. There are still test failures. For one thing, I need #1427 before I can attempt to fix some of the failures, because of the consistency it brings to expand() across hash randomization.

For the grover failures, one of the trig failures, and the separate related failure, I am waiting on feedback from the community on how to best proceed (see respectively [1](https://groups.google.com/forum/?fromgroups#!topic/sympy/fD0COkYrNcw), [2](https://groups.google.com/forum/?fromgroups#!topic/sympy/0qR7oFlHTTM), and [3](https://groups.google.com/forum/?fromgroups#!topic/sympy/4sz8gArhsk0)).

Note that this completely fixes the issue 3022 problem. I do not know if any other outstanding issues are fixed by this. It also addresses [4](https://groups.google.com/forum/?fromgroups#!topic/sympy/KRhvgZjqlQI).

Finally, as noted in the e716d20 commit message, this does not yet address the complex hint to expand. Assuming the fix that I want to do works, though, a commit for it should be coming soon.

Regardless of these, please start reviewing.