sympy/sympy — pull request #1162 by rlamy (2012-03-22 01:47:41+00:00)
Title: Refactoring the old assumptions

Here's a major refactoring of the old assumption system. This amounts to a complete rewrite of sympy.core.assumptions and of a large part of sympy.core.facts. The important changes are:

* assumptions are now stored in a custom dict subclass
* Basic doesn't accept assumption kwargs any more, only Symbol and its subclasses do.
* For non-Symbols, "assumptions" are now best thought of as a property cache.
* For Symbols, assumptions are a static dict computed upon instance creation.
* Pickling has been refactored. It's now independent of `__slots__` and all protocols behave like protocol 2.
* Instance-level caches (e.g. `_assumptions`, `_mhash`) aren't pickled any more, which makes (some/most) pickles several times smaller.
* AssumeMixin is gone. (I'd hoped it would allow jython to work again, but it just doesn't like mixing `__slots__` and multiple inheritance)

I guess this'll be a bit painful to review, so thanks in advance. I've tried to keep commits small and focused in the hope that most of them can be understood without knowing the big picture.