title: return multiple generators python
body: <p>This is in reference to <a href="https://stackoverflow.com/questions/25345290/flask-sub-function-not-yielding-results">flask sub function not yielding results</a></p>
  
  <p>How can I return multiple generators, like so ...</p>
  
  <p>Currently no matter what I try, it does the first one only, for instance if I do a list of generators and loop through that, it still does the first one.</p>
  
  <p>Any thoughts?</p>
  
  <pre><code>#!/usr/bin/env python
  
  import flask
  import time
  
  class TestClass(object):
  
      def __init__(self):
          pass
  
      def worker(self):
          a='1234'
          b=a + '45\n'
          yield b
          time.sleep(3)
          yield a
  
      def worker2(self):
          time.sleep(3)
          c = '9876'
          yield c
  
  tc = TestClass()
  app = flask.Flask(__name__)
  
  
  @app.route('/')
  def test_method_get_stuff():
      return flask.render_template('index.html')
  
  @app.route('/', methods=['POST'])
  def test_method_post_stuff():
      def test_method_sub_function():
          return tc.worker()
          return tc.worker2()
      return flask.Response(test_method_sub_function(),mimetype= 'text/plain')
  
  app.run(debug=True)
  </code></pre>