title: Understanding the Python 'with' statement
body: <p>I'm trying to understand if there is there a difference between these, and what that difference might be.</p>
  
  <p>Option One:</p>
  
  <pre><code>file_obj = open('test.txt', 'r')
  
  with file_obj as in_file:
      print in_file.readlines()
  </code></pre>
  
  <p>Option Two:</p>
  
  <pre><code>with open('test.txt', 'r') as in_file:
      print in_file.readlines()
  </code></pre>
  
  <p>I understand that with Option One, the <code>file_obj</code> is in a closed state after the with block.</p>