def product_bases(w):
    nc = w.args_cnc()[1]
    return len(nc) == 2 or len(nc) == 1 and nc[0].is_Pow and nc[0].exp == 2

but could you have b1**2*b1**2 -> b1**4 in which case the test above would
be nc[0].exp.is_Integer and sqrt(nc[0].exp).is_Integer might be better?
Could you have (b1**(x*Rational(1, 3)))**2?

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to