title: Return value of __exit__
body: <p>I understand that</p>
  
  <ul>
  <li><p><code>__enter__</code> and <code>__exit__</code> are used to implement a context manager. </p></li>
  <li><p>if an exception occurs in a <code>with</code> statement, the exception's type, value and traceback are passed to the <code>__exit__</code> method.</p></li>
  <li><p><code>__exit__</code> can handle the exception:</p>
  
  <ol>
  <li>Returning <code>True</code>: the exception is gracefully handled.</li>
  <li>Returning anything else: the <code>with</code> statement raises the exception</li>
  </ol></li>
  </ul>
  
  <hr>
  
  <p><strong>I came across the following <code>__exit__</code> method. Is the return statement  redundant?</strong> </p>
  
  <pre><code>def __exit__(self, type, value, traceback):
      self.close()
      return type == None
  </code></pre>
  
  <p>since it seems to me that,</p>
  
  <ul>
  <li>If no exception occurred, <code>type</code> will naturally be <code>None</code>, so <code>__exit__</code> returns true. Nothing is raised.</li>
  <li>If an exception did occur, <code>type</code> is set to the actual exception type, so <code>__exit__</code> returns false. The exception is raised as is.</li>
  </ul>