add .get() to CaseInsensitiveDict
This commit is contained in:
parent
d454f9b732
commit
fa95eaa9eb
1 changed files with 2 additions and 0 deletions
|
@ -251,6 +251,8 @@ class CaseInsensitiveDict(dict):
|
||||||
return dict.__setitem__(self, key.lower(), value)
|
return dict.__setitem__(self, key.lower(), value)
|
||||||
def __contains__(self, key: str):
|
def __contains__(self, key: str):
|
||||||
return dict.__contains__(self, key.lower())
|
return dict.__contains__(self, key.lower())
|
||||||
|
def get(self, key: str, default: typing.Any=None):
|
||||||
|
return dict.get(self, key.lower(), default)
|
||||||
|
|
||||||
def is_ip(s: str) -> bool:
|
def is_ip(s: str) -> bool:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue