title: With statement, auto-delete object
body: <p>Is it possible to delete an object form inside its class?</p>
  
  <pre><code>class A():
      def __init__(self):
          print("init")
          self.b="c"
      def __enter__(self):
          print("enter")
          return self
      def __exit__(self, type, value, traceback):
          print("exit")      
  
  with A() as a:
      print(a.b)
  print(a.b)
  </code></pre>
  
  <p>returns:</p>
  
  <pre><code>init
  enter
  c
  exit
  c
  </code></pre>
  
  <p>How comes I still have access to the <code>a</code> object after exiting the <code>with</code> ? Is there a way to auto-delete the object in <code>__exit__</code>?</p>