Or better yet, `assert s.series() in [piecewise, piecewise.subs({a:b, b:a}, simultaneous=True)]`.