Case:
Suppose we have a very complex list [1,[2,2,2],[3,[4,5[6]]],7,8], and we need to convert it into a one-row list.
Solution:
iter_fuc():
return sum(map( lambda a: iter_fuc(a) if isinstance(a, (list)) else [a] , array))
Lambda functions -- 差不多就是python的inline function, 需要注意的是lambda彻底就是function,因此在其中是无法print 和raise的.
顺路看了个wiki:http://www.secnetix.de/olli/Python/lambda_functions.hawk
filter(), map(), reduce()都可以和lambda结合起来一起使用