title: ldap3 library: modify attribute with multiple values
body: <p>Trying to modify an ldap attribute that has multiple values, can't seem to figure out the syntax.</p>
  
  <p>I'm using the <a href="https://github.com/cannatag/ldap3" rel="nofollow">ldap3</a> library with python3.</p>
  
  <p>The <a href="http://ldap3.readthedocs.io/modify.html" rel="nofollow">documentation</a> gives an example which modifies <em>two</em> attributes of an entry - but each attribute only has <em>one</em> value.</p>
  
  <p>The dictionary from that example is the bit I'm having trouble with:</p>
  
  <pre><code>c.modify('cn=user1,ou=users,o=company',
       {'givenName': [(MODIFY_REPLACE, [&lt;what do I put here&gt;])]})
  </code></pre>
  
  <p>Instead of 'givenname' which would have one value I want to modify the memberuid attribute which obviously would have many names as entries.</p>
  
  <p>So I spit all my memberuids into a list, make the modification, and then am trying to feed my new usernames/memberuid list to the MODIFY command. 
  Like so:</p>
  
  <pre><code>oldval = 'super.man'
  newval = 'clark.kent'
  
  existingmembers = ['super.man', 'the.hulk', 'bat.man']
  newmemberlist = [newval if x==oldval else x for x in existingmembers]
  # newmemberlist = ", ".join(str(x) for x in newmemberlist)
  </code></pre>
  
  <p>I've tried passing in newmemberlist as a list</p>
  
  <pre><code>'memberuid': [(MODIFY_REPLACE, ['clark.kent', 'the.hulk','bat.man'])] 
  </code></pre>
  
  <p>which gives me <code>TypeError: 'str' object cannot be interpreted as an integer</code></p>
  
  <p>or various combinations (the commented line) of one long string, separated with spaces, commas, semi colons and anything else I can think of </p>
  
  <pre><code>'memberuid': [(MODIFY_REPLACE, 'clark.kent, the.hulk, bat.man')]
  </code></pre>
  
  <p>which does the replace but I get <em>one</em> memberuid looking like this
    <code>'clark.kent, the.hulk, bat.man'</code></p>