Message77403
On 2008-12-09 10:59, Raymond Hettinger wrote:
> Raymond Hettinger <rhettinger@users.sourceforge.net> 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. |
|
Date |
User |
Action |
Args |
2008-12-09 11:53:19 | lemburg | set | recipients:
+ lemburg, brett.cannon, georg.brandl, rhettinger, amaury.forgeotdarc, mark.dickinson, pitrou, christian.heimes, benjamin.peterson |
2008-12-09 11:53:18 | lemburg | link | issue1717 messages |
2008-12-09 11:53:15 | lemburg | create | |
|