> To "fix" all 2-arg-muls in an expression something like this might work:
>
>>>> m.subs([(m2, Mul(*m2.args)) for m2 in m.atoms(Mul) if
> ...  m2.is_Mul and m2.args[0].is_Number and
> ... m2.as_coeff_Mul()[1].is_Add])
> ...
> a/2 + 1
>

Or (please) review https://github.com/sympy/sympy/pull/1041 where the
result above (a/2 + 1) is what is obtained.

/c

-- 
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en.

Reply via email to