3 ms·
Better yet just combine map and filter into a list comprehension: def action(thing): ... return [func(x) for x in thing if func2(x)]
by doc_gunthrop 7y ago
Better yet just combine map and filter into a list comprehension:
def action(thing):
...
return [func(x) for x in thing if func2(x)]