| 238 | |
| 239 | # Use a different map than a dict |
| 240 | class lowerdict(dict): |
| 241 | def __getitem__(self, key): |
| 242 | if isinstance(key, str): |
| 243 | key = key.lower() |
| 244 | return dict.__getitem__(self, key) |
| 245 | def __contains__(self, key): |
| 246 | if isinstance(key, str): |
| 247 | key = key.lower() |
| 248 | return dict.__contains__(self, key) |
| 249 | |
| 250 | c = ChainMap() |
| 251 | c['a'] = 1 |