Skip to content

Instantly share code, notes, and snippets.

@mattrobenolt
Created November 1, 2012 22:04
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 mattrobenolt/3996960 to your computer and use it in GitHub Desktop.
Save mattrobenolt/3996960 to your computer and use it in GitHub Desktop.
json = raw_response.json
type_ = json['type']
cls = type(str(type_), (Response,), {})
response = cls()
func = functools.partial(setattr, response)
map(lambda t: func(*t), json.iteritems())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment