sympy/sympy — pull request #1868 by placasse (2013-03-04 20:52:30+00:00)
Title: Piecewise should accepts Piecewise for condition

This may happens in piecewise_fold :
p1 = Piecewise((sin(x), x < 0), (0, True))
p2 = Piecewise((0, Eq(p1, 0)), (p1 / Abs(p1), True))
p3 = piecewise_fold(sin(p2))