Skip to content

Instantly share code, notes, and snippets.

@Lucretiel
Created October 6, 2016 21:22
Show Gist options
  • Save Lucretiel/ca17c3b11d85ba3f16cdc3c8d37a2ba9 to your computer and use it in GitHub Desktop.
Save Lucretiel/ca17c3b11d85ba3f16cdc3c8d37a2ba9 to your computer and use it in GitHub Desktop.
def emit(list_of_elements):
for elem in list_of_elements:
if elem.thing1 > 0:
yield elem.thing1
if elem.thing2 < 0:
yield elem.thing2
if elem.thing3 != 0:
yield elem.thing3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment