title: Why isn't a callable callable within a Python with block?
body: <p>Any rhyme or reason as to why a callable isn't callable within a Python 3.5 <code>with</code> statement?</p>
  
  <pre><code>class Seriously(object):
      def __init__(self, name):
          self.name = name
  
      def __enter__(self):
          print("Enter " + self.name)
  
      def __call__(self):
          print("Call " + self.name)
  
      def __exit__(self, type, value, traceback):
          print("Exit " + self.name)
  
  a = Seriously('a')
  a.__enter__()
  a()
  a.__enter__()
  
  with Seriously('b') as b:
      b()
  </code></pre>
  
  <p>seriously produces</p>
  
  <pre><code>Enter a
  Call a
  Enter a
  Enter b
  Exit b
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-6-91a5d11e1b2e&gt; in &lt;module&gt;()
       18 
       19 with Seriously('b') as b:
  ---&gt; 20     b()
  
  TypeError: 'NoneType' object is not callable
  </code></pre>
  
  <p>What am I missing in <a href="https://www.python.org/dev/peps/pep-0343/" rel="nofollow noreferrer">PEP 343</a>?</p>