symengine.py
symengine.py copied to clipboard
Implement the sort_key method for compatibility with sympy
When replacing the Integer class in sympy with the same class in symengine the sympy unit tests fail because of the missing sort_key method.
import sympy
x = sympy.Integer(1)
x.sort_key()
Out[1]: ((1, 0, 'Number'), (0, ()), (), 1)
At a first glance the output of the method is hard to penetrate. Do we need to replicate the exact same behaviour?