1 from sympy
import symbols
2 from sympy
.core
.relational
import Relational
, Equality
, StrictInequality
, \
3 Rel
, Eq
, Lt
, Le
, Gt
, Ge
, Ne
9 Relational(x
, y
, '!=') # this used to raise
13 e
= Relational(x
, y
, '==')
16 assert isinstance(e
, Equality
)
20 e
= Relational(x
, y
, '<')
23 assert isinstance(e
, StrictInequality
)
31 res
= Relational(y
, e
, '==')
32 assert Rel(y
, x
+x
**2, '==') == res
33 assert Eq(y
, x
+x
**2) == res
35 res
= Relational(y
, e
, '<')
36 assert Lt(y
, x
+x
**2) == res
38 res
= Relational(y
, e
, '<=')
39 assert Le(y
, x
+x
**2) == res
41 res
= Relational(y
, e
, '>')
42 assert Gt(y
, x
+x
**2) == res
44 res
= Relational(y
, e
, '>=')
45 assert Ge(y
, x
+x
**2) == res
47 res
= Relational(y
, e
, '!=')
48 assert Ne(y
, x
+x
**2) == res