It looks like Poly.from_dict will do it:
In [6]: p = Poly(6*x**4*y**5 + 3*x*y**2,y,x)
In [7]: p.as_dict()
Out[7]: {(2, 1): 3, (5, 4): 6}
In [8]: p.from_dict(p.as_dict(), y, x)
Out[8]: Poly(6*y**5*x**4 + 3*y**2*x, y, x, domain='ZZ')
The order of the generators is the same as the order in the Poly. I
don't remember if there is a better method on Poly for reordering
generators, but in the above example Poly(p, x, y) will reorder them.
Aaron Meurer
> --
> 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
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/sympy.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sympy/b03e1f10-6b62-4725-ab01-a142b26d8a06%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.