[sympy] Re: Match: expected behavior or bug?

2009-06-20 Thread asmeurer
I have also noticed this with the same Wild variables: >>> print (exp(x)*exp(y)).match(c*d) {d_: exp(y), c_: exp(x)} >>> print (exp(x)*exp(y)*y).match(c*d) {d_: y*exp(y), c_: exp(x)} >>> print (x*exp(x)*exp(y)*y).match(c*d) None I think that I may need to write my own function to do this if I ca

[sympy] Re: Match: expected behavior or bug?

2009-06-20 Thread asmeurer
On Jun 19, 6:42 pm, "Aaron S. Meurer" wrote: > I have been working on getting separable equations in dsolve, and I   > noticed this: >  >>> c = Wild('c', exclude=[y]) >  >>> d = Wild('d', exclude=[x]) >  >>> (x).match(c*d) > {c: x, d: 1} >  >>> (log(x)).match(c*d) > {c: log(x), d: 1} >  >>> (x*

[sympy] Re: Or and And with 0 or 1 argument

2009-06-20 Thread Fabian Pedregosa
Fredrik Johansson wrote: > On Sat, Jun 20, 2009 at 2:30 PM, Fabian Pedregosa wrote: >> Hi Ronan! >> >> >> Ronan Lamy wrote: >>> I've noticed that the boolean functions Or and And in the new >>> sympy.logic subpackage are defined to raise ValueError when called >>> with 0 or 1 argument. However, th

[sympy] Re: Or and And with 0 or 1 argument

2009-06-20 Thread Fredrik Johansson
On Sat, Jun 20, 2009 at 2:30 PM, Fabian Pedregosa wrote: > > Hi Ronan! > > > Ronan Lamy wrote: >> I've noticed that the boolean functions Or and And in the new >> sympy.logic subpackage are defined to raise ValueError when called >> with 0 or 1 argument. However, there are perfectly sound mathemat

[sympy] Re: Or and And with 0 or 1 argument

2009-06-20 Thread Fabian Pedregosa
Hi Ronan! Ronan Lamy wrote: > I've noticed that the boolean functions Or and And in the new > sympy.logic subpackage are defined to raise ValueError when called > with 0 or 1 argument. However, there are perfectly sound mathematical > definitions for those cases: > Or() -> False > Or(A) -> A > A