title: using function from different module as decorator in python
body: <p>I have read few pages on the usage of decorators in python and was trying out few examples on how to use it. I was able to get it right when i try to have the decorator function and the orignal function all in the same script.
  I am trying 2 set of codes here where i have specific intentions to be performed. Kindly help me in understanding what mistake i am making.</p>
  
  <p>1.In this example, i have written by decorator function in script "dec1.py" and i am trying to import this in my second script "script.py", where i am getting TypeError "wrapper1() takes no arguments (1 given)"</p>
  
  <pre><code>###########dec1.py#####################
  def setup (setup_funct):
      def wrapper1():
          print "******Test Section setup******"
          return setup_funct()
      return wrapper1
  ###########script.py################
  import dec1
  
  class setup(object):
      @dec1.setup
      def tc_setup():
          print "Configure X"
  c1=setup()
  c1.tc_setup()
  </code></pre>
  
  <p>2.Is it possible to have a method defined under a class to be used as a decorator function?. Here is what i am trying to run but it gives me the same TypeError "TypeError: wrapper1() takes no arguments (1 given)"</p>
  
  <pre><code>class Common(object):
      def setup (setup_funct):
          def wrapper1():
              print "******Test Section setup******"
              return setup_funct()
          return wrapper1
  
  c1=Common()
  
  @c1.setup()
  def tc_setup():
      print "Configure X"
  
  
  tc_setup()
  </code></pre>