aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index 17adf79b..1b218b60 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -171,3 +171,11 @@ def top_10(items: typing.Dict[typing.Any, typing.Any],
value_format(items[key])))
return top_10_items
+
+class CaseInsensitiveDict(dict):
+ def __init__(self, other):
+ dict.__init__(self, ((k.lower(), v) for k, v in other))
+ def __getitem__(self, key):
+ return dict.__getitem__(self, key.lower())
+ def __setitem__(self, key):
+ return dict.__setitem__(self, key.lower())