Skip to content

Instantly share code, notes, and snippets.

@tml
Created June 17, 2018 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tml/93fb81123c01d0f6e224df1222aa541e to your computer and use it in GitHub Desktop.
Save tml/93fb81123c01d0f6e224df1222aa541e to your computer and use it in GitHub Desktop.
def u_filter(func, iterable):
if f is None:
return (item for item in iterable if item)
return (item for item in iterable if func(item))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment