Updates:
        Cc: ronan.l...@gmail.com christian.muise

Comment #7 on issue 2070 by asmeurer: All elements of .args should be Basic
http://code.google.com/p/sympy/issues/detail?id=2070

Well, first off, would Basic True and False objects be useful? Maybe Ronan, Christian, or someone else interested in the logic stuff can answer this.

If not, I think the cleanest solution (maybe the cleanest solution anyway) would be to do a similar thing that we did for Integral. If an expression is an "otherwise" expression, just put it in the .args instead of an ExprCondPair. So, for example, the .args for the Piecewise in [23] would be (ExprCondPair(x, x < 1), y). Then it would be understood that if an element of .args is not an ExprCondPair, it is for the "otherwise" condition. Also, since "otherwise" can occur only once per Piecewise, I think we should normalize it to always be the last item in .args. The reason is that rebuilding from .args has to work too, so we would have to allow Piecewise((x, x < 1), y) to return the same thing as Piecewise((x, x < 1), (y, True)). By the way, this is a similar syntax that Maple uses for piecewise (except it does not require each pair to be grouped with a tuple, it just has piecewise(cond1, expr1, …, condn, exprn, expr_otherwise) (actually, our syntax is better in at least one respect, which is that it isn't backwards).

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

Reply via email to