case sensitivity

Michael Ströder michael at stroeder.com
Tue Feb 26 17:38:09 CET 2002


Bobby Beckmann wrote:
> 
> Since the attribute/value set is returned as a dict, the proper case
> is necessary when using that dict. Since we need case-insensitive
> lookups, I've patched ldapobject.py to use a custom case-insensitive
> dict. 

1. You should *not* patch ldapobject.py directly. You should sub-class 
ldapobject.LDAPObject if you need a different behaviour.

2. There's also module cidict shipped with python-ldap which sub-classes 
UserDict.UserDict providing a case-insensitive dictionary class.

> Are there any plans to provide something like this in the released
> lib

I won't add those kind of changes to ldapobject.LDAPObject. Let's keep 
that part of python-ldap easy to understand. I prefer to see in the 
results more or less exactly what comes out of the OpenLDAP libs.

Also the approach with just a case-insensitive dictionary looks to naive 
to me. The dictionary class should be case-preserving which is slightly 
more complicated. IMHO things like language sub-types (cn;lang-en-EN) 
and transfer encodings (;binary) should be supported.

I have plans to implement such a thing but spare time is sparse at the 
moment.

Ciao, Michael.





More information about the python-ldap mailing list