Marc-Andre Lemburg <[EMAIL PROTECTED]> added the comment: On 2008-12-09 10:59, Raymond Hettinger wrote: > Raymond Hettinger <[EMAIL PROTECTED]> added the comment: > > Moving cmp() somewhere other than builtins is not progress. IMO, it > needs to die off and the concept of it needs to disappear completely. > Code is better without it. Three-way comparisons are PITA to use -- > their only virtue is as an optimization in the few cases where one > three-way test is cheaper to compute than two two-way tests. > > The goal for 3.0 was to have one way to do it and thereby simplify the > language. Tucking it away in a module or writing a new decorator > defeats the purpose. It simply should die and go away.
The idea was to have one implementation of the work-around (a>b) - (b<a) instead of 10 or so instances of this snippet in the Python stdlib and probably a few hundred places in other code. Indeed, the motivation is to have one obvious way to write this work-around :-) Note that cmp() doesn't make __cmp__ come back, but it does help porting code that uses cmp(). Besides, cmp() is available builtin in 3.0, so it's too late to just remove it anyway. We'd have to go through the usual deprecation process. _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1717> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com