[python3-ldap] python3-ldap 0.9.5.4 released

Will Yardley python.org at veggiechinese.net
Wed Sep 24 00:44:39 CEST 2014


On Tue, Sep 23, 2014 at 10:23:15PM +0000, Joseph L. Casale wrote:
> > I wonder if there's a terser or easier to read way of doing this:
> > 
> > from ldap3 import [...] SEARCH_SCOPE_WHOLE_SUBTREE
> > c.search('o=test','(objectClass=*)', SEARCH_SCOPE_WHOLE_SUBTREE, [...]
> 
> You can't format your code differently?
> 
> c.search(
>     'o=test',
>     '(objectClass=*)',
>     SEARCH_SCOPE_WHOLE_SUBTREE,
>     [...]
> )
> 
> Frankly, this is far more readable, makes more sense in a diff and just plain looks
> better.

Sure, I was just paraphrasing the example. I can (and would) format the
code differently.

But, I still personally find:
      scope=foo
simpler and easier to read / understand.

I know there are plusses and minuses of doing
import ldap3
vs.
from ldap3 import [....]
as used in the example.

but having to import various constants there also becomes unwieldy
quickly.

w
 


More information about the python3-ldap mailing list