最好方式使用filter,代码示例:
def _filter(self, item): if(item[‘status‘] == 0): return False return True #lambda e:e%2!=0 data[‘items‘] = filter(self._filter,data[‘items‘])
参考资料:
http://www.cnblogs.com/GODYCA/archive/2013/06/04/3116887.html
http://blog.csdn.net/emaste_r/article/details/47406143
时间: 2024-11-06 09:53:01