Re: min() & max() vs sorted()

2006-09-15 Thread Paddy
MRAB wrote: > Tim Peters wrote: > > [MRAB] > > > Some time after reading about Python 2.5 and how the built-in functions > > > 'min' and 'max' will be getting a new 'key' argument, I wondered how > > > they would treat those cases where the keys were the same, for example: > > > > > > L = ["four",

Re: min() & max() vs sorted()

2006-09-15 Thread Tim Peters
[MRAB] >>> Some time after reading about Python 2.5 and how the built-in functions >>> 'min' and 'max' will be getting a new 'key' argument, I wondered how >>> they would treat those cases where the keys were the same, for example: >>> >>> L = ["four", "five"] >>> print min(L, key = len), max(L, ke

Re: min() & max() vs sorted()

2006-09-15 Thread MRAB
Tim Peters wrote: > [MRAB] > > Some time after reading about Python 2.5 and how the built-in functions > > 'min' and 'max' will be getting a new 'key' argument, I wondered how > > they would treat those cases where the keys were the same, for example: > > > > L = ["four", "five"] > > print min(L,

Re: min() & max() vs sorted()

2006-09-14 Thread Tim Peters
[MRAB] > Some time after reading about Python 2.5 and how the built-in functions > 'min' and 'max' will be getting a new 'key' argument, I wondered how > they would treat those cases where the keys were the same, for example: > > L = ["four", "five"] > print min(L, key = len), max(L, key = len) > >

min() & max() vs sorted()

2006-09-14 Thread MRAB
Hi, Some time after reading about Python 2.5 and how the built-in functions 'min' and 'max' will be getting a new 'key' argument, I wondered how they would treat those cases where the keys were the same, for example: L = ["four", "five"] print min(L, key = len), max(L, key = len) The result is: