UnevaluateExpr is still somewhat experimental. It looks like passing
evaluate=False to the Piecewise does the trick.
However, this could be considered a bug. How does it result in bigger
and bigger expressions with the folding?
Aaron Meurer
On Wed, Oct 3, 2018 at 8:50 PM Nathaniel Virgo wrote:
When constructing a sympy.PIecewise object, it automatically calls
piecewise_fold if it finds a Piecewise inside a condition. I would like to
prevent this, because I’m using sympy for code generation and this
auto-expansion is causing my expressions to explode exponentially.
Here is a