Comment #2 on issue 2626 by asmeurer: Piecewise should use a different syntax for "otherwise"
http://code.google.com/p/sympy/issues/detail?id=2626

Would it ever make sense for Piecewise to hold Tuples? If so, then we have to wrap the last condition around a tuple. Otherwise, there is no way to differentiate between

Piecewise(Tuple(some_Tuple, cond), ..., otherwise_Tuple) # Returns a Tuple for the otherwise condition

and

Piecewise(Tuple(some_Tuple, cond), ..., otherwise_Tuple) # otherwise_Tuple is interpreted as an expr, cond pair.

Does that make sense?

Perhaps this should never be allowed, as Tuple is not really a mathematical object, so shouldn't be inside a Piecewise. I do agree that just having it as the last object would be cleaner. I don't like the idea of having some Otherwise singleton that the user has to import and we have to maintain just to accomodate Piecewise (unless you see other uses for it).

So I'm actually +1 for either Piecewise(..., otherwise_expr) or Piecewise(..., (otherwise_expr,)). We just need to change it from the way that it is now.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to