Comment #23 on issue 2307 by [email protected]: Duplicate methods:
as_coeff_mul and as_coeff_Mul
http://code.google.com/p/sympy/issues/detail?id=2307
It's a headache either way to do what the other is doing:
to miimic as_coeff_mul()
c, m = expr.as_coeff_Mul()
margs = Mul.make_args(m)
if not c.is_Rational:
c, m = S.One, expr
to mimic as_coeff_Mul
if expr.is_Mul:
a, b = expr.as_two_terms()
if not a.is_Number:
a, b = S.One, expr
else:
a, b = S.One, expr
or
c, margs = expr.as_coeff_mul()
if margs and margs[0].is_Number:
c *= margs[0]
margs = margs[1:]
m = object.__new__(Mul)._new_rawargs(*margs)
I've proposed some alternative names. With epath, perhaps the user will be
encouraged to access pieces via that. Internally, I think both have their
place.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.