def __getitem__(self, key): """Get key value """ d_key = try_lower(key) try: return self.__dict__.get(d_key)[1] except KeyError: raise KeyError(key) except TypeError: raise KeyError(key)
def __delitem__(self, key): """Delete key/value. """ d_key = try_lower(key) del self.__dict__[d_key]
def __setitem__(self, key, value): """Set key to value. """ d_key = try_lower(key) self.__dict__[d_key] = (key, value)
def __contains__(self, key): """True if has a key, else False. """ d_key = try_lower(key) return d_key in self.__dict__