Skip to content

Commit

Permalink
use IterableUserDict in ldap.cidict
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder authored and Petr Viktorin committed Nov 22, 2017
1 parent 591ec60 commit 08ff14e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lib/ldap/cidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
See https://www.python-ldap.org/ for details.
"""

__version__ = """$Revision: 1.15 $"""
__version__ = """$Revision: 1.16 $"""

from UserDict import UserDict
from UserDict import IterableUserDict
from string import lower

class cidict(UserDict):
class cidict(IterableUserDict):
"""
Case-insensitive but case-respecting dictionary.
"""

def __init__(self,default=None):
self._keys = {}
UserDict.__init__(self,{})
IterableUserDict.__init__(self,{})
self.update(default or {})

def __getitem__(self,key):
Expand All @@ -39,7 +39,7 @@ def update(self,dict):
self[key] = dict[key]

def has_key(self,key):
return UserDict.has_key(self,lower(key))
return IterableUserDict.has_key(self,lower(key))

def __contains__(self,key):
return self.has_key(key)
Expand Down

0 comments on commit 08ff14e

Please sign in to comment.