Status: Accepted
Owner: [email protected]
Labels: Type-Defect Priority-Low Python3

New issue 2674 by [email protected]: Remove the cmp_to_key() helper function
http://code.google.com/p/sympy/issues/detail?id=2674

A helper function, cmp_to_key, was introduced with commit d68d33. The problem was that Python 3 no longer supports the cmp() function, and it cannot be used as an argument in sort() or sorted(). The idea behind the helper function was to avoid those issues for the moment and leave it for the future. As Python 3 support is (mostly) in now, the future is now. :)

cmp_to_key should not be used any more. This probably means changing our __cmp__ methods to rich comparisons but I'm not sure yet so lets keep this as a first goal. I will work on this. I do consider it low priority, though, as it doesn't really impact any functionality.

See also what Aaron said in this comment[1]: "It appears that in a lot of cases, compare_pretty is being used with cmp_to_key. This is wrong. It should just use default_sort_key (or some variation of sort_key())."

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to