예제 #1
0
    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)
예제 #2
0
 def __delitem__(self, key):
     """Delete key/value.
     """
     d_key = try_lower(key)
     del self.__dict__[d_key]
예제 #3
0
 def __setitem__(self, key, value):
     """Set key to value.
     """
     d_key = try_lower(key)
     self.__dict__[d_key] = (key, value)
예제 #4
0
 def __contains__(self, key):
     """True if has a key, else False.
     """
     d_key = try_lower(key)
     return d_key in self.__dict__