title: Can I retrieve the return value of __exit__ from a python context manager?
body: <p>I use context manager in python. In want to get some logs back from my <code>__exit__</code> method. So my code logs something like this:</p>
  
  <pre><code>class MyContextManager:
      def __init__(self, value1, value2)
          self.value1 = value1
          self.value2 = value2
  
      def __enter__(self)
          # Do some other stuff
          return self
  
      def __exit__(self, exc_type, exc_val, exc_tb):
          # Do some tear down action, process some data that is 
          # created in __enter__ and log those results
          return my_results
  
  with MyContextManager(value1=my_value1, value2=my_value2) as manager:
       # Do some stuff
  </code></pre>
  
  <p>So how could I access my_results which is returned from <code>__exit__</code> after (or at the end) of my with block. Is this even legit to return something other the True in the <code>__exit__</code> method?</p>