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 2bf93fd9af
commit c84be3fb4f
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -38,13 +38,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)