This is a slightly frivolous question:
I have a piece of python code with a lot of filter-map-reduce functions.
I'm finding it a bit painful retyping eg.
filter(lambda x: x['identity'] == 'creosote', skits)
each time. I'd like to be able to do something like
filter(f(x['identity']==creosote),skits)
instead. I've tried :
def f(y):
f = lambda(x: y)
but that doesn't seem to work. Thanks
I get a NameError: name 'x' is not defined
What I'm trying to accomplish is to "symlink" lambda x: to something so that I don't have to type it.