title: Python iterable and context manager
body: <p>I want behaviour as such:</p>
  
  <pre><code>with A() as f:
      for x in f:
          do_something(f)
  </code></pre>
  
  <p>is this the right way to do it?</p>
  
  <pre><code>class A:
      def __enter__(self):
          print "Entering context"
  
      def __iter__(self):
          for x in ["some","list"]:
              yield x
  
      def __exit__(self):
          print "Deleting context"
  </code></pre>