title: return of ThreadPoolExecutor to array of tasks
body: <p>Below is an  example code I got from <a href="https://tutorialedge.net/python/concurrency/python-threadpoolexecutor-tutorial/" rel="nofollow noreferrer">https://tutorialedge.net/python/concurrency/python-threadpoolexecutor-tutorial/</a></p>
  
  <pre><code>from concurrent.futures import ThreadPoolExecutor
  import threading
  import random
  
  taskarr = []
  
  def task(n,c):
      print("Executing our Task = {} and {}".format(n,c))
      print("Task Executed {}".format(threading.current_thread()))
  
  def main():
      executor = ThreadPoolExecutor(max_workers=3)
      task1 = executor.submit(task(1,'A'))
      task2 = executor.submit(task(2,'B'))
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>in this, if executor.submit is returned to simple variable task1, it works. But my requirement is to return it to an array. so when i do,
      taskarr[0] = executor.submit(task(1,'A'))
  it throws error as,</p>
  
  <pre><code>TypeError: 'function' object does not support item assignment
  </code></pre>