On Fri, 1 May 2020 at 12:09, David Bailey <d...@dbailey.co.uk> wrote:
>
> On 01/05/2020 00:32, Oscar Benjamin wrote:
>
> Hi Aaron,
>
> Yes, if we had Equation we should disallow its use in an expression. I
> don't see any situation where it would make sense. We would need a
> clear distinction between Equation and Equality as well as methods to
> convert between them.
>
> 1. Equality is a Boolean
> 2. Equation is Basic
> 3. Neither is Expr
> 4. You can use `.as_Boolean/.as_Equation` or something to convert between
> 5. Equation should be used instead of Equality for e.g. passing
> equations to solve/dsolve and for returning solutions.
> 6. Equation should be invalid in any Boolean context
> 7. Equality should not support any of the arithmetic manipulations
> that Equation does
> 8. Equation should be usable in subs or subseq or something (but
> Equality should not)
> 9. Equation should have a solve method for making something the lhs
> 10. Documentation should find a way of making this understandable...
>
> Hang on, doesn't that exclude the very operations we were just discussing, 
> such as
>
> 3+Equation(a-3,b-3)

That example works fine with Equation:

In [5]: a, b = symbols('a, b')

In [6]: 3+Equation(a-3,b-3)
Out[6]: a = b

It doesn't work with Eq/Equality though. E.g. in 1.6:

In [7]: 3+Eq(a-3,b-3)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-d5998316a014> in <module>
----> 1 3+Eq(a-3,b-3)

TypeError: unsupported operand type(s) for +: 'int' and 'Equality'

--
Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxTfeGTAOpbPKpD-GCRc_NM0n%3DyXSBC63ztp34LaR-2nJQ%40mail.gmail.com.

Reply via email to