class LowerCaseDict(dict):

    def __setitem__(self, key, val):
        if not key.islower():
            raise TypeError('%s key must be lowercase' % key)
dict.__setitem__(self, key, val)
ld = LowerCaseDict()
ld['g'] = 'g'
How to ensure that a python dict keys are lowercase?