Skip to content

Instantly share code, notes, and snippets.

@brainsik
brainsik / dotdict.py
Created June 11, 2011 00:31
Override Python's dict with this for JS style dot notation access :-)
# encoding: utf-8
class DotDict(dict):
def __init__(self, *a, **kw):
dict.__init__(self, *a, **kw)
for key in self:
self._validate_key(key)
def _validate_key(self, key):