Raymond Hettinger wrote: >>>>instance: >>>> >>>> lst = ['A', 'b', 'C'] >>>> lst.sort(key=partialmethod('lower')) >>> >>>We've already got one: >>> >>> lst.sort(key=operator.attrgetter('lower')) >> >>Doesn't that just sort on the str.lower or unicode.lower method >> object? > > My mistake. It sorts on the bound method rather than the results of > applying that method.
Then I thought it might be right to do partial(operator.attrgetter('lower')). This, however, accomplishes exactly nothing. I only decided this after actually trying it, though upon reflection partial(function) always accomplishes nothing. I don't have any conclusion from this, but only mention it to demonstrate that callables on top of callables are likely to confuse. -- Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com