title: python: yield inside map function
body: <p>Is it possible to use yield inside the map function?</p>
  
  <p>For POC purpose, I have created a sample snippet. </p>
  
  <pre><code># Python 3  (Win10)
  from concurrent.futures import ThreadPoolExecutor
  import os
  def read_sample(sample):
      with open(os.path.join('samples', sample)) as fff:
          for _ in range(10):
              yield str(fff.read())
  
  def main():
      with ThreadPoolExecutor(10) as exc:
          files = os.listdir('samples')
          files = list(exc.map(read_sample, files))
          print(str(len(files)), end="\r")
  
  if __name__=="__main__":
       main()
  </code></pre>
  
  <p>I have 100 files in samples folder. As per the snippet 100*10=1000 should be printed. However, it prints 100 only. When I checked it just print generator object only.</p>
  
  <p>With what change it'll be 1000 printed? </p>