Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: Yes, that's a wonderful thing, because from the code I see around 99.9% of people see the cmp and just use it, totally ignoring the presence of the 'key' argument, that allows better and shorter solutions of the sorting problem. Me too because I

Re: python 3: sorting with a comparison function

2008-10-10 Thread Thomas Heller
Thomas Heller wrote: Does Python 3 have no way anymore to sort with a comparison function? Both [].sort() and sorted() seem to accept only 'key' and 'reverse' arguments, the 'cmp' argument seems to be gone. Can that be? Terry Reedy schrieb: Yes. When this was discussed, no one could

Re: python 3: sorting with a comparison function

2008-10-10 Thread pruebauno
On Oct 10, 8:35 am, Kay Schluehr [EMAIL PROTECTED] wrote: On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: Yes, that's a wonderful thing, because from the code I see around 99.9% of people see the cmp and just use it, totally ignoring the presence of the 'key' argument, that allows better and

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 19:22, [EMAIL PROTECTED] wrote: On Oct 10, 8:35 am, Kay Schluehr [EMAIL PROTECTED] wrote: On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: Yes, that's a wonderful thing, because from the code I see around 99.9% of people see the cmp and just use it, totally ignoring the

Re: python 3: sorting with a comparison function

2008-10-10 Thread bearophileHUGS
Kay Schluehr: Sometimes it helps when people just make clear how they use technical terms instead of invoking vague associations. And generally Python docs can enjoy growing few thousands examples... Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3: sorting with a comparison function

2008-10-10 Thread Paul McGuire
On Oct 10, 12:22 pm, [EMAIL PROTECTED] wrote: On Oct 10, 8:35 am, Kay Schluehr [EMAIL PROTECTED] wrote: On 9 Okt., 22:36, [EMAIL PROTECTED] wrote: Yes, that's a wonderful thing, because from the code I see around 99.9% of people see the cmp and just use it, totally ignoring the

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 20:38, [EMAIL PROTECTED] wrote: Kay Schluehr: Sometimes it helps when people just make clear how they use technical terms instead of invoking vague associations. And generally Python docs can enjoy growing few thousands examples... Cleaning up and extending documentation is a

Re: python 3: sorting with a comparison function

2008-10-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: Kay Schluehr: Sometimes it helps when people just make clear how they use technical terms instead of invoking vague associations. And generally Python docs can enjoy growing few thousands examples... Well, that may not be necessary. But I think that a clear

Re: python 3: sorting with a comparison function

2008-10-10 Thread Terry Reedy
Kay Schluehr wrote: Me too because I don't get this: key specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower. The default value is None. I am not sure what you do not get, but it should say 'for example, key=str.lower. None is

Re: python 3: sorting with a comparison function

2008-10-10 Thread Kay Schluehr
On 10 Okt., 23:04, Terry Reedy [EMAIL PROTECTED] wrote: Kay Schluehr wrote: Me too because I don't get this: key specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower. The default value is None. I am not sure what you do not

python 3: sorting with a comparison function

2008-10-09 Thread Thomas Heller
Does Python 3 have no way anymore to sort with a comparison function? Both [].sort() and sorted() seem to accept only 'key' and 'reverse' arguments, the 'cmp' argument seems to be gone. Can that be? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3: sorting with a comparison function

2008-10-09 Thread bearophileHUGS
Thomas Heller: the 'cmp' argument seems to be gone. Can that be? Yes, that's a wonderful thing, because from the code I see around 99.9% of people see the cmp and just use it, totally ignoring the presence of the 'key' argument, that allows better and shorter solutions of the sorting problem.

Re: python 3: sorting with a comparison function

2008-10-09 Thread Terry Reedy
Thomas Heller wrote: Does Python 3 have no way anymore to sort with a comparison function? Both [].sort() and sorted() seem to accept only 'key' and 'reverse' arguments, the 'cmp' argument seems to be gone. Can that be? Yes. When this was discussed, no one could come up with an actual use