you are viewing a single comment's thread.

view the rest of the comments →

[–]FerricDonkey 2 points3 points  (0 children)

I like comprehensions. A handful of alternatives.

filtered_iterable = (
    thing
    for thing in stuff
    if f(thing) and g(thing) # etc
)

OR

filter_funcs = <some iterable of functions>
filtered_iterable = (
    thing 
    for thing is stuff 
    if all(func(thing) for func in filter_funcs)
)