Skip to content

Instantly share code, notes, and snippets.

@sloria
Last active December 19, 2015 04:18
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 sloria/5895782 to your computer and use it in GitHub Desktop.
Save sloria/5895782 to your computer and use it in GitHub Desktop.
# Meh
def match(self, items):
for each in items:
if each.match(self):
return each
# Is this supposed to reach the end? Is this a bug?
# Better
def match(self, items):
for each in items:
if each.match(self):
return each
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment