Skip to content

Commit

Permalink
remove asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
smichr committed Sep 30, 2024
1 parent 7bb6aab commit 0816d9b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions sympy/polys/polytools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4052,19 +4052,11 @@ def cancel(f, g, include=False):
cq = dom.to_sympy(cq)

c, n, d = cp/cq, per(p), per(q)
if c.is_Integer:
if n.domain == QQ:
n, d = map(per, [i.convert(ZZ) for i in (p, q)])
elif c.is_Rational and n.domain == ZZ:
assert None
n, d = map(per, [i.convert(QQ) for i in (p, q)])
if c.is_Integer and n.domain == QQ:
n, d = map(per, [i.convert(ZZ) for i in (p, q)])
return c, n, d
else:
n, d = map(per, result)
if n.domain == QQ and any(i.dom == ZZ for i in result):
assert None
n, d = map(per, [i.convert(ZZ) for i in result])
return n, d
return tuple(map(per, result))

def make_monic_over_integers_by_scaling_roots(f):
"""
Expand Down

0 comments on commit 0816d9b

Please sign in to comment.