aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar jesopo2018-12-08 09:13:01 +0000
committerGravatar jesopo2018-12-08 09:13:01 +0000
commit1c546a8244e9d334b835d9e74bfeb1b3eafdae40 (patch)
tree72b8a1bc6177ef02585612370b6477979e499d9e /src/utils
parentReturn empty string on successful github webhook handling, not True (diff)
signature
Add typing hints to CaseInsensitiveDict, fix it's __setitem__ signature, call
.items() on `other` in ctor
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index 1b218b60..5267b79f 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -173,9 +173,9 @@ def top_10(items: typing.Dict[typing.Any, typing.Any],
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):
+ def __init__(self, other: typing.Dict[str, typing.Any]):
+ dict.__init__(self, ((k.lower(), v) for k, v in other.items()))
+ def __getitem__(self, key: str) -> typing.Any:
return dict.__getitem__(self, key.lower())
- def __setitem__(self, key):
- return dict.__setitem__(self, key.lower())
+ def __setitem__(self, key: str, value: typing.Any) -> typing.Any:
+ return dict.__setitem__(self, key.lower(), value)