Using lambda with filter is kind of dumb when we have other methods available.
In this case, I will probably solve the specific problem this way (or using an equivalent generator expression)
>>> a = [[1, 2, 3], [4, 5, 6]] >>> [item for item in a if sum(item) > 10] [[4, 5, 6]]
or if I need to unpack, for example
>>> [(x, y, z) for x, y, z in a if (x + y) ** z > 30] [(4, 5, 6)]
If I really needed a function, I could use the unpacking of the tuple arguments (which, by the way, was removed in Python 3.x, since people donβt use it): lambda (x, y, z): x + y + z takes a tuple and unpacks the three elements x , y and z . (Note that you can also use this in def , i.e.: def f((x, y, z)): return x + y + z .)
You can, of course, use unpacking the destination style ( def f(item): x, y, z = item; return x + y + z ) and indexing ( lambda item: item[0] + item[1] + item[2] ) in all versions of Python.