sympy/sympy — pull request #1720 by mrocklin (2013-01-20 18:14:55+00:00)
Title: Refactor sympy.stats

A few substantial infrastructure changes to `sympy.stats`

1. RandomSymbols no longer inherit from Symbol, they now inherit from Expr. This removes a substantial amount of magic and exposes a number of problems in the previous sympy.stats class tangle
2. Most classes now follow the `type(obj)(*obj.args) = obj` rule. Particularly the domains and pspaces are substantially more consistent
3. All of the FooPSpace classes have been turned into FooDensity classes. Note that PSpaces still exist (they are necessary for complex queries) but in the univariate case the information about distributions is pushed down a level. This is for eventual use with rewrite rules and handcoded CDFs and such. This is related to [issue 3129](https://code.google.com/p/sympy/issues/detail?id=3129)

This pull request is an effort to clean up sympy.stats so that it may cooperate with unification as an alternative method to simplify statistical queries.