From 2e7bf4c46eebbc214abd4d3363c5e509746d8a32 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 2 Apr 2023 05:56:53 +0300 Subject: [PATCH] XXX drop expand() --- diofant/polys/constructor.py | 4 ++-- diofant/polys/polyutils.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/diofant/polys/constructor.py b/diofant/polys/constructor.py index 2c8d242ad87..c85c28f58c3 100644 --- a/diofant/polys/constructor.py +++ b/diofant/polys/constructor.py @@ -114,8 +114,8 @@ def _construct_composite(coeffs, opt): for coeff in coeffs: numer, denom = coeff.as_numer_denom() - numers.append(numer) - denoms.append(denom) + numers.append(numer.expand()) + denoms.append(denom.expand()) try: polys, _opt = _parallel_dict_from_expr(numers + denoms, diff --git a/diofant/polys/polyutils.py b/diofant/polys/polyutils.py index a7b8abab66a..447592a3f2a 100644 --- a/diofant/polys/polyutils.py +++ b/diofant/polys/polyutils.py @@ -215,9 +215,6 @@ def _parallel_dict_from_expr(exprs, opt): if any(not expr.is_commutative for expr in exprs): raise PolynomialError('non-commutative expressions are not supported') - if opt.expand is not False: - exprs = [expr.expand() for expr in exprs] - if not opt.gens: opt = opt.clone({'gens': _find_gens(exprs, opt)})