On Apr 8, 9:34 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes:
> > > a) def flip(f): return lambda x,y: f(y,x) > > Curious resemblance to: > > itemgetter(1,0) > > Not sure I understand that. I think he read it as lambda (x, y): (y, x) More interesting would be functools.rshift/lshift, that would rotate the positional arguments (with wrapping) def f(a, b, c, d, e): ... rshift(f, 3) --> g, where g(c, d, e, a, b) == f(a, b, c, d, e) Still don't see much advantage over writing a lambda (except perhaps speed). -Mike -- http://mail.python.org/mailman/listinfo/python-list