title: Break or exit out of "with" statement?
body: <p>I'd just like to exit out of a <code>with</code> statement under certain conditions:</p>
  
  <pre><code>with open(path) as f:
      print 'before condition'
      if &lt;condition&gt;: break #syntax error!
      print 'after condition'
  </code></pre>
  
  <p>Of course, the above doesn't work. Is there a way to do this? (I know that I can invert the condition: <code>if not &lt;condition&gt;: print 'after condition'</code> -- any way that is like above?)</p>