diff --git a/symengine/lib/symengine_wrapper.in.pyx b/symengine/lib/symengine_wrapper.in.pyx index 6fe0ffa5..fac3a4da 100644 --- a/symengine/lib/symengine_wrapper.in.pyx +++ b/symengine/lib/symengine_wrapper.in.pyx @@ -4944,7 +4944,7 @@ def powermod_list(a, b, m): def has_symbol(obj, symbol=None): cdef Basic b = _sympify(obj) cdef Basic s = _sympify(symbol) - require(s, (Symbol, FunctionSymbol)) + require(s, (Symbol, FunctionSymbol, Infinity, NegativeInfinity, NaN)) if (not symbol): return not b.free_symbols.empty() else: diff --git a/symengine/tests/test_expr.py b/symengine/tests/test_expr.py index 8cbf4ab7..3d5e5d01 100644 --- a/symengine/tests/test_expr.py +++ b/symengine/tests/test_expr.py @@ -26,3 +26,11 @@ def test_as_powers_dict(): assert (x*(1/Integer(2))**y).as_powers_dict() == {x: Integer(1), Integer(2): -y} assert (2**y).as_powers_dict() == {2: y} assert (2**-y).as_powers_dict() == {2: -y} + + +def test_has(): + x = Symbol('x') + assert (x + oo).has(oo) + assert (x - oo).has(-oo) + assert not (x + oo).has(-oo) + #assert not (x - oo).has(oo) <-- not sure we want to test explicitly for "x + NegativeInfinity" diff --git a/symengine_version.txt b/symengine_version.txt index 549ada38..12d3bf39 100644 --- a/symengine_version.txt +++ b/symengine_version.txt @@ -1 +1 @@ -153b7e98f310bccaae586dab6b49284ccd5f4174 +8759c8e5ca76306c663f3372702136fc622a14a8