sympy/sympy — pull request #2859 by hargup (2014-02-01 06:09:44+00:00)
Title: Piecewise: added as_expr_set_pair property

This came up in the discussion at https://groups.google.com/forum/#!topic/sympy/x7IgsNoofNE.
This method will be useful in general while handling `Piecewise` functions. A few examples can be
- in evaluating imageset for Piecewise functions
- in plotting Piecewise function. Currently `plot` cannot plot even simple Piecewise functions like `Piecewise((x, x > 0), (-x, True))`
- in solving expressions like `Piecewise(((x - 2)**2, x >= 0), (0, True))`. See line 305 `sympy.functions.elementary.tests.test_piecewise`