Skip to content

Instantly share code, notes, and snippets.

@aperson
Created April 17, 2012 21:07
Show Gist options
  • Save aperson/2409055 to your computer and use it in GitHub Desktop.
Save aperson/2409055 to your computer and use it in GitHub Desktop.
Ways to pull out a value from a dict case insensitively
def ids (t, d):
for i in d.keys():
if re.match(r'^{}$'.format(t), i, re.I):
return d[i]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment