title: In Python, if I return inside a "with" block, will the file still close?
body: <p>Consider the following:</p>
  
  <pre><code>with open(path, mode) as f:
      return [line for line in f if condition]
  </code></pre>
  
  <p>Will the file be closed properly, or does using <code>return</code> somehow bypass the <a href="https://docs.python.org/library/contextlib.html">context manager</a>?</p>