symengine.py icon indicating copy to clipboard operation
symengine.py copied to clipboard

Implement the sort_key method for compatibility with sympy

Open rikardn opened this issue 3 years ago • 0 comments

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?

rikardn avatar Apr 02 '22 15:04 rikardn