Comment #27 on issue 2307 by [email protected]: as_coeff_mul()[0] != as_coeff_Mul()[0] when the coeff is Number (not Rational)
http://code.google.com/p/sympy/issues/detail?id=2307

If you really want to combine these, I guess I would recommend making as_coeff_Mul take a Real or Rational hint and perhaps and `args` hint so
    >>> (3.*x*y).as_coeff_Mul(Real) would return (3.0, x*y)
    >>> (3.*x*y).as_coeff_Mul(Rational) would return (1, 3.0*x*y)
>>> (3.*x*y).as_coeff_Mul(Rational, args=True) would return (1, (3.0, x, y)) So as not to depend on importing Real and Rational, perhaps 1 or 1.0 could be passed for the coeff_hint instead. I don't think the deps option for as_coeff_foo is being used anywhere but would have to double check that. (So losing that capability might not cause any problems; if that was removed then as_independent with the as_Add keyword followed by return_value[1] a list would duplicate the as_coeff_mul behavior.)

--
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.

Reply via email to