
Dec. 2, 2003
9:54 p.m.
On Tuesday 02 December 2003 11:02 am, Paul Moore wrote:
Alex Martelli <aleaxit@yahoo.com> writes:
Since these functions or types are going to be in operator, I think we can afford to "spend" two names to distinguish functionality (even though attgetter and itemgetter look nowhere as neat as extract -- I don't have better suggestions offhand).
operator.getattr and operator.getitem?
I think the functions they're talking about are actually right-curried versions of those functions, like this: def attrgetter(attr): return lambda x: getattr(x, attr) Jeremy