Comment #7 on issue 3968 by [email protected]: factor_list() error Python3
http://code.google.com/p/sympy/issues/detail?id=3968
Fixing this doesn't seem to be so easy. Can you tackle it Mateusz?
Basically, I want _symbolic_factor_list to use parallel_poly_from_expr, as
this seems to be the only canonical way to convert multiple expressions in
to polynomials with the same generators (I can't even do it inefficiently
by trying to guess what the generators are ahead of time, because the
algorithm is buried in _parallel_dict_from_expr_no_gens, and there isn't a
more than 2-arg unify that I could post-process with). But this function
does more than convert the arguments of the Mul to poly: it grabs the
coefficients (OK, I could probably preprocess to do this), but also, it has
try:
poly, _ = _poly_from_expr(base, opt)
except PolificationFailed as exc:
factors.append((exc.expr, exp))
else:
func = getattr(poly, method + '_list')
which I guess is some kind of fallback if Poly can't work on an expression
for whatever reason. I am not sure how to reproduce using the parallel
method. Assumedly the whole parallel function would fail with that
exception.
That's the *right* way to fix it, because I do think that factor_list
should return polynomials with the same generators, even internally. An
easier way might be to work around it in the sort key, but even then, I
don't see how to easily unify a list of polynomials (as opposed to just
two). Of course, one could do something like Ondrej's "solution", but that
just implements an arbitrary ordering (which, I guess to be fair, is pretty
much what it uses right now in Python 2).
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.