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 > And() -> True > And(A) -> A > > Using these would allow one to write things like: > assert solve(Eq(poly, 0)) == Or(*[Eq(r, 0) for r in roots(poly)]) > > and I don't see any drawback. What's the reason for the current > choice? The mathematical definition of And that I used defined it as a function B^2 --> B, so I did not know what should be expected if called with 0 or 1 arguments. However, we can change that if it can improve the module. Just tell me, what is the mathematical reason behind Or() -> False, And() -> True ? > > > > > -- http://fseoane.net/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en -~----------~----~----~----~------~----~------~--~---
