Skip to content

Instantly share code, notes, and snippets.

@iambibhas
Created May 3, 2013 05:48
Show Gist options
  • Save iambibhas/5507412 to your computer and use it in GitHub Desktop.
Save iambibhas/5507412 to your computer and use it in GitHub Desktop.
Python simple dictionary to MultiDict-like object
class SimpleMultiDict(dict):
def getlist(self, key):
return self[key] if type(self[key]) == list else [self[key]]
def __repr__(self):
return type(self).__name__+'('+dict.__repr__(self)+')'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment