Skip to content

Companion commit to symengine/symengine#2105 #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion symengine/lib/symengine_wrapper.in.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions symengine/tests/test_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion symengine_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
153b7e98f310bccaae586dab6b49284ccd5f4174
8759c8e5ca76306c663f3372702136fc622a14a8
Loading