News for hackers. Stuff that matters.
Re:Functional programming with Python by apendleton on Saturday October 27, 2012 @05:05PM (#4707234)
attrgetter takes an attribute name and returns a function that, when passed an object, returns that attribute from that object. So it's a curried getattr. These are equivalent:

f = attrgetter("some_property")

f = lambda obj: getattr(obj, "some_property")

There are no comments on this comment yet.