sympy/sympy — pull request #2108 by jrioux (2013-05-14 22:49:18+00:00)
Title: Allow to specify the generators when building monomial_key.

This allows to obtain a sort key that can be directly applied to sort `Expr` instances; it casts `Expr` into `Poly` with the given generators and then applies the chosen ordering.