Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
>>> def a(order):
... todo = []
... for i in order:
... def g(i):
... return lambda x: x[i]
,,, todo.append(g(i))
... def b(x):
... return [do(x) for do in todo]
... return b
>>> b = a([2, 0, 1])
>>> b(["a", "b", "c"])
<<< ['b', 'b', 'b']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.