title: Why can @decorator not decorate a staticmethod or a classmethod?
body: <p>Why can <code>decorator</code> not decorate a staticmethod or a classmethod?</p>
  
  <pre><code>from decorator import decorator
  
  @decorator
  def print_function_name(function, *args):
      print '%s was called.' % function.func_name
      return function(*args)
  
  class My_class(object):
      @print_function_name
      @classmethod
      def get_dir(cls):
          return dir(cls)
  
      @print_function_name
      @staticmethod
      def get_a():
          return 'a'
  </code></pre>
  
  <p>Both <code>get_dir</code> and <code>get_a</code> result in <code>AttributeError: &lt;'classmethod' or 'staticmethod'&gt;,  object has no attribute '__name__'</code>.</p>
  
  <p>Why does <code>decorator</code> rely on the attribute <code>__name__</code> instead of the attribute <code>func_name</code>? (Afaik all functions, including classmethods and staticmethods, have the <code>func_name</code> attribute.)</p>
  
  <p>Edit: I'm using Python 2.6.</p>