title: How can I implement pattern event to call classmethod in Python?
body: <p>I want to call some function depend on event code how can I do it in Python?</p>
  
  <p>I made such code but it not works and I am user that only one step to make it working.</p>
  
  <pre><code>class Thing(object):
      @classmethod
      def do1(cls):
          print 'do1'
  
      @classmethod
      def do2(cls):
          print 'do2'
  
      eventToMethod = {'1': do1,
                       '2': do2}
  
      @classmethod
      def onEvent(cls, name):
          method = cls.eventToMethod.get(name)
          if method != None:
              method()
  
  Thing.onEvent('1')
  </code></pre>
  
  <p>Whatever I get such errors and has not idea how to call classmethods in Python way.</p>
  
  <pre><code>TypeError: 'classmethod' object is not callable
  </code></pre>
  
  <p>Can you help with this simple problem?</p>