From: <mi...@st...> - 2007-10-22 13:05:30
|
James Andrewartha wrote: > > --- cidict.py~ 2003-08-25 00:28:12.000000000 +0800 > +++ cidict.py 2007-10-22 20:16:54.000000000 +0800 > @@ -43,6 +43,9 @@ > def has_key(self,key): > return UserDict.has_key(self,lower(key)) > > + def __contains__(self,key): > + return UserDict.has_key(self,lower(key)) > + > def get(self,key,failobj=None): > try: > return self[key] I'd prefer if it's ok for you: def __contains__(self,key): return self.has_key(self,key) If you're using ldap.schema you might want to look into using class ldap.schema.models.Entry instead of simply ldap.cidict.cidict because you don't have to care about attribute description aliases and mapping them to OIDs. Ciao, Michael. |