Skip to content

Commit

Permalink
polys: cleanup _minpoly_compose(), don't use __class__ magic property
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jul 19, 2018
1 parent 8e23d0b commit 6282c68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions diofant/polys/numberfields.py
Expand Up @@ -506,13 +506,13 @@ def _minpoly_compose(ex, x, dom):
res = _minpoly_exp(ex, x)
else:
res = _minpoly_pow(ex.base, ex.exp, x, dom)
elif ex.__class__ is sin:
elif isinstance(ex, sin):
res = _minpoly_sin(ex, x)
elif ex.__class__ is cos:
elif isinstance(ex, cos):
res = _minpoly_cos(ex, x)
elif ex.__class__ is RootOf:
elif isinstance(ex, RootOf):
res = _minpoly_rootof(ex, x)
elif ex.__class__ is conjugate:
elif isinstance(ex, conjugate):
res = _minpoly_compose(ex.args[0], x, dom)
else:
raise NotAlgebraic("%s doesn't seem to be an algebraic element" % ex)
Expand Down

0 comments on commit 6282c68

Please sign in to comment.