title: python threading confusing code 'int' object is not callable
body: <p>its messy i know, but the threading is so confusing ...i dont know if the problem is in my sintax or if it is in the method im using...
  the def do inserts in mysql (and its working when is not threading),another strange thing is that after runing the code i noticed rows are inserted correctly but i still get "self._target(*self._args, **self._kwargs)
  TypeError: 'int' object is not callable"</p>
  
  <pre><code>def thistaginsert(tagy):
      global idn
      global forbidentags
      global termcount
      tagy = tagy[0]
      if not tagy.isdigit():
          if not tagy in forbidentags:
              wordpress.execute(s_term % tagy)
              term0 = wordpress.fetchall()
              term0 = term0[0][0]
              if term0 == 0:
                  tmp_i_term = i_term.format(tag1=tagy, tag2=tagy)
                  wordpress.execute(tmp_i_term)
                  cnx2.commit()
                  tmp_s_termname = s_termname.format(buceta=tagy)
                  wordpress.execute(tmp_s_termname)
                  term = wordpress.fetchall()
                  term = term[0]
                  wordpress.execute(i_termtax % term)
                  cnx2.commit()
                  wordpress.execute(s_tax % term)
                  tax_id = wordpress.fetchall()
                  tax_id = tax_id[0][0]
                  tmp_i_RL = i_RL.format(idn=idn, taxid=tax_id)
                  wordpress.execute(tmp_i_RL)
                  cnx2.commit()
                  termcount += 1
              else:
                  tmp_s_termname = s_termname.format(buceta=tagy)
                  wordpress.execute(tmp_s_termname)
                  term = wordpress.fetchall()
                  term = term[0]
                  wordpress.execute(s_tax % term)
                  tax_id = wordpress.fetchall()
                  tax_id = tax_id[0][0]
                  tmp_i_RL = i_RL.format(idn=idn, taxid=tax_id)
                  wordpress.execute(tmp_i_RL)
                  cnx2.commit()
                  termcount += 1
          return termcount
  .
  .
  . #many lines later
                  if tags:
                    for tag in tags:
                          ttt = Thread(target=thistaginsert(tag))
                          ttt.start()
                          threads.append(ttt)
                  else:
                      print('no tags')
  </code></pre>