title: Passing static methods in python
body: <p>Could you explain why the following code snippet doesn't work?</p>
  
  <pre><code>class A:
      @staticmethod
      def f():
          print('A.f')
  
      dict = {'f': f}
  
  def callMe(g):
      g()
  
  callMe(A.dict['f'])
  </code></pre>
  
  <p>It yields</p>
  
  <pre><code>TypeError: 'staticmethod' object is not callable
  </code></pre>
  
  <p>Interesingly, changing it to</p>
  
  <pre><code>class A:
      @staticmethod
      def f():
          print('A.f')
  
      dict = {'f': f}
  
  def callMe(g):
      g()
  
  callMe(A.f)
  </code></pre>
  
  <p>or to</p>
  
  <pre><code>class A:
      @staticmethod
      def f():
          print('A.f')
  
      dict = {'f': lambda: A.f()}
  
  def callMe(g):
      g()
  
  callMe(A.dict['f'])
  </code></pre>
  
  <p>gives the expected result</p>
  
  <pre><code>A.f
  </code></pre>
  
  <p>As far as I see the behaviour is the same in Python 2 and 3.</p>