sympy/sympy — pull request #2917 by mrocklin (2014-02-16 17:15:44+00:00)
Title: WIP - evaluate context manager

Sometimes we want to turn off automatic evaluation. We usually suggest that people make the following change

```Python
# Before
x + x

# After
Add(x, x, evaluate=False)
```

This is ugly and, more importantly, hard to do on large complex operations.

This PR sets the default value of the `evaluate` keyword to a globally accessible variable. It then introduces an `evaluate` context manager to manage that global variable

```Python
>>> from sympy.abc import x
>>> from sympy.core.operations import evaluate
>>> print x + x
2*x
>>> with evaluate(False):
... print x + x
x + x
```

This PR is only a proof of concept. It only works on `AssocOp`. I think that it should be easy to extend to other operations.