title: Python3-LDAP not returning expected results
body: <p>I'm using the Python 3 LDAP library <a href="https://pypi.python.org/pypi/python3-ldap" rel="nofollow">here</a>. I don't understand its behavior with regards to the '&lt;=' operator. </p>
  
  <p>I have a range of <code>uidNumber</code>s that I need to test for specific values. I'm breaking the range up in to chunks so I can parallelize each section. So, the filters on the queries look like:</p>
  
  <p><code>(&amp;(uid=MY_UID)(&amp;(uidNumber&gt;=chunk_start)(uidNumber&lt;=chunk_end)))</code></p>
  
  <p>The <code>uidNumber</code> associated with the <code>uid</code> I'm searching for is in between <code>chunk_start</code> and <code>chunk_end</code>. However. Running the query above on an <code>ldap3.Connection</code> object returns no results. Specifically, I get back:</p>
  
  <pre><code>[{'description': 'success',
    'dn': '',
    'message': '',
    'referrals': None,
    'result': 0,
    'type': 'searchResDone'}]
  </code></pre>
  
  <p>Running the same query through <code>curl</code> produces the correct result, so I poked around more in <code>ldap3</code>. I found that queries with the <code>&gt;=</code> operator worked as expected, but nothing with the <code>&lt;=</code> operator ever produced any results. Searching for both a <code>uidNumber</code> and a <code>uid</code> produces the following:</p>
  
  <pre><code>In [175]: res = c.search('######' 
                  '(&amp;(uid=######)(uidNumber&lt;=#######))', 
                   ldap3.SEARCH_SCOPE_WHOLE_SUBTREE, 
                   attributes=['objectClass', 'displayName'])
  
  In [176]: c.getResponse(res)
  Out[176]: 
  [{'description': 'success',
    'dn': '',
    'message': '',
    'referrals': None,
    'result': 0,
    'type': 'searchResDone'}]
  </code></pre>
  
  <p>Switching the <code>&lt;=</code> for <code>&gt;=</code> and leaving the <code>uidNumber</code> in the query the same produces the correct result. </p>
  
  <p>I also noticed that if I drop the <code>uid</code> parameter, <code>getResult</code> returns <code>None</code>, rather than a list with no results.</p>
  
  <p>What's going wrong here? </p>
  
  <p>EDIT: </p>
  
  <p>Grepping 'uidNumber` in the schema produces this result:</p>
  
  <pre><code>attributeTypes: ( 1.3.6.1.1.1.1.0 NAME 'uidNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'RFC 2307' )
  objectClasses: ( 1.3.6.1.1.1.2.0 NAME 'posixAccount' DESC 'Standard LDAP objectclass' SUP top AUXILIARY MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) MAY ( userPassword $ loginShell $ gecos $ description ) X-ORIGIN 'RFC 2307' )
  </code></pre>
  
  <p>Looking up RFC 2307, in turn, says this: </p>
  
  <pre><code>( nisSchema.1.0 NAME 'uidNumber'
            DESC 'An integer uniquely identifying a user in an
                  administrative domain'
            EQUALITY integerMatch SYNTAX 'INTEGER' SINGLE-VALUE )
  </code></pre>
  
  <p>Does the <code>EQUALITY integerMatch</code> line mean that it doesn't support ordering? Is it just a fluke that <code>curl</code> is returning correct results?</p>