Allow for kwargs to be used in object initialization

This commit is contained in:
Erik Johnson 2019-01-30 15:35:37 -06:00
parent 0e760b59ba
commit d06526c7a2
No known key found for this signature in database
GPG Key ID: 5E5583C437808F3F

View File

@ -23,13 +23,13 @@ class CaseInsensitiveDict(MutableMapping):
Inspired by requests' case-insensitive dict implementation, but works with
non-string keys as well.
'''
def __init__(self, init=None):
def __init__(self, init=None, **kwargs):
'''
Force internal dict to be ordered to ensure a consistent iteration
order, irrespective of case.
'''
self._data = OrderedDict()
self.update(init or {})
self.update(init or {}, **kwargs)
def __len__(self):
return len(self._data)