[Tutor] string to list
stefan_ml at behnel.de
Thu Feb 11 14:37:34 CET 2010
Kent Johnson, 11.02.2010 14:16:
> On Thu, Feb 11, 2010 at 4:44 AM, Stefan Behnel wrote:
>> 2) given that you have lists as items in the 'data' list, it's enough to
>> call sort() once, as the comparison of lists is defined as the comparison
>> of each item to the corresponding item of the other list. If you want to
>> sort based on the second item before the first item, it's best to exchange
>> both items before sorting and swap them back afterwards.
> No, that is the old decorate-sort-undecorate idiom which has been
> replaced by the key= parameter to sort.
Nothing keeps you from writing
(which is equivalent)
More information about the Tutor