goodok/sympy — comment on commit 113f6b9fe8689816c3e072de3277ec8561fcde79
File: sympy/functions/elementary/tests/test_piecewise.py line 166
By goodok:

I suppose that this assertions incorrect for both variants of sorting too:

This is the first variant of sorting (master):

```
>>> p = Piecewise((1,Interval(0,1,False,True)),(0,True)); p
⎧1 for [0, 1)
⎨
⎩0 otherwise

>>> expand((1-x)*p)
- x⋅⎧1 for [0, 1) + ⎧1 for [0, 1)
⎨ ⎨
⎩0 otherwise ⎩0 otherwise

>>> piecewise_fold(_)
⎧ -x + 1 for [0, 1)
⎪
⎨⎧-x for [0, 1) otherwise
⎪⎨
⎩⎩0 otherwise

>>> expand(piecewise_fold((1-x)*p))
⎧-x + 1 for [0, 1)
⎨
⎩ 0 otherwise
```

In this branch:

```
>>> p = Piecewise((1,Interval(0,1,False,True)),(0,True)); p
⎧1 for [0, 1)
⎨
⎩0 otherwise

>>> expand((1-x)*p)
- x⋅⎧1 for [0, 1) + ⎧1 for [0, 1)
⎨ ⎨
⎩0 otherwise ⎩0 otherwise

>>> piecewise_fold(_)
⎧ -x + 1 for [0, 1)
⎪
⎨⎧1 for [0, 1) otherwise
⎪⎨
⎩⎩0 otherwise

>>> expand(piecewise_fold((1-x)*p))
⎧-x + 1 for [0, 1)
⎨
⎩ 0 otherwise
```

Third results of `piecewise_fold(_)` differ from each other. I do not know what exactly about aims of `piecewise_fold` function, but I can't understand it logic by it outputs.