Raymond Hettinger wrote: > [Ian Bicking] > > I think partial() misses an important use case of method getting, for > > 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? py> sorted(['A', u'b', 'C'], key=operator.attrgetter('lower')) [u'b', 'C', 'A'] py> sorted(['A', u'b', 'C'], key=partialmethod('lower')) # after fixing arg -> args bug ['A', u'b', 'C'] STeVe -- You can wordify anything if you just verb it. --- Bucky Katt, Get Fuzzy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4