This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author catlee
Recipients
Date 2007-02-15.00:17:07
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The motivation for this patch was to be able to chain together operator.itemgetter objects so that I could sort a list of items that have the form ((a,b), c) by the 'a' or 'b' part of the item.

Sorting by 'b' can be accomplished with:
l.sort(key=compose(itemgetter(1), itemgetter(0)))

compose(itemgetter(1), itemgetter(0)) is equivalent to

def c(v):
    return itemgetter(1)(itemgetter(0)(v))
History
Date User Action Args
2007-08-23 15:56:34adminlinkissue1660179 messages
2007-08-23 15:56:34admincreate