title: Calling a coroutine synchronously
body: <p>Imagine the following very common situation: you have written a long and complicated function and realize that some of the code should be extracted into a seperate function for reuse and/or readability. Usually, this extra function call will not change the semantics of your program.</p>
  
  <p>However, now imagine that your function is a coroutine and the code you want to extract contains at least one asyncronous call. Extracting it into a separate function now suddenly changes your programs semantics by inserting a new point on which the coroutine yields, the event loop takes control and any other coroutine could be scheduled in between.</p>
  
  <p>Example before:</p>
  
  <pre><code>async def complicated_func():
      foo()
      bar()
      await baz()
  </code></pre>
  
  <p>Example after:</p>
  
  <pre><code>async def complicated_func():
      foo()
      await extracted_func()
  
  async def extracted_func():
      bar()
      await baz()
  </code></pre>
  
  <p>In the example before, the <code>complicated_func</code> is guaranteed not to be suspended between calling <code>foo()</code> and calling <code>bar()</code>. After refactoring, this guarantee is lost.</p>
  
  <p>My question is this: is it possible to call <code>extracted_func()</code> such that it is executed immediately as if its code would be inline? Or is there some other way to perform such common refactoring tasks without changing the programs semantics?</p>