title: Decorator to convert an instance method into a class function
body: <p>I need to pass several methods as callbacks which don't take the <code>self</code> argument. This is how my current code looks like:</p>
  
  <pre><code>def _do_callback(callback, log, *args):
      try:
          # some common code
          callback(*args)
      except:
          log.error('XX')
  
  class Foo(object):
      def __init__(self):
          self.log = Log('Foo')
          self.cb1_wrapper = lambda x: _do_callback(self.cb1, self.log, x)  # I need a function taking one parameter
          self.cb2_wrapper = lambda x: _do_callback(self.cb2, self.log, x)
  
      def cb1(self, x):
          # some code accessing self
  
      def cb2(self, x):
          # some code accessing self
  
      def register_callbacks(self):
          register('1', self.cb1_wrapper)
          register('2', self.cb2_wrapper)
  </code></pre>
  
  <p>Is it possible to write some decorator to apply to <code>cb1</code> and <code>cb2</code> to be able to pass the result into code that currently takes <code>self.cb1_wrapper</code>?</p>
  
  <p>(I know the title is not ideal, feel free to edit)</p>