Skip to content

Instantly share code, notes, and snippets.

@bmneely
Created June 6, 2014 19:02
Show Gist options
  • Save bmneely/6907b3fb2c5f447ea633 to your computer and use it in GitHub Desktop.
Save bmneely/6907b3fb2c5f447ea633 to your computer and use it in GitHub Desktop.
# Better
attribute = "{0}_{1}".format(match_rule.ttype, 'string_start')
starts_with = match_rule.__dict__[attribute]
# Bad
match_rule.__dict__["{0}_{1}".format(match_rule.ttype, 'string_start')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment