Skip to content

Commit

Permalink
Fix cython syntax, add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bjodah committed May 27, 2024
1 parent b0f15af commit f6426fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions symengine/lib/symengine_wrapper.in.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,9 @@ class Equality(Relational):
def is_Equality(self):
return True

func = __class__
@property
def func(self):
return self.__class__


Eq = Equality
Expand All @@ -1648,7 +1650,9 @@ class Unequality(Relational):
s = self.args_as_sage()
return sage.ne(*s)

func = __class__
@property
def func(self):
return self.__class__


Ne = Unequality
Expand Down
5 changes: 4 additions & 1 deletion symengine/tests/test_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def test_relationals():
assert Ge(1, 1) == true
assert Eq(I, 2) == false
assert Ne(I, 2) == true
eq = Eq(x, y)
assert eq.func(*eq.args) == eq
ne = Ne(x, y)
assert ne.func(*ne.args) == ne


def test_rich_cmp():
Expand Down Expand Up @@ -118,4 +122,3 @@ def test_Contains():
assert Contains(x, Interval(1, 1)) != false
assert Contains(oo, Interval(-oo, oo)) == false
assert Contains(-oo, Interval(-oo, oo)) == false

0 comments on commit f6426fc

Please sign in to comment.