Skip to content

Instantly share code, notes, and snippets.

@leahein
Last active October 23, 2016 03:25
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 leahein/f7a47a443e813d4837f1881749465530 to your computer and use it in GitHub Desktop.
Save leahein/f7a47a443e813d4837f1881749465530 to your computer and use it in GitHub Desktop.
parse_by_class
def parse_by_class(self, value):
if type(value).__name__ == 'unicode': # Do something with strings
if type(value).__name__ == 'list': # Do something with arrays
if type(value).__name__ == 'dict': # Do something with dictionaries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment