title: Unable to use decorator defined in other file in python
body: <p>I am trying to use decorator for printing my logs. And to do this, I have defined decorator in one file named custom_logger.py :</p>
  
  <pre><code>import logging
  
  class Logger(object):
     def __init__(self,decoratee_enclosing_class):
          self.decoratee_enclosing_class = decoratee_enclosing_class
     def __call__(self, aFunc):
        """Trace entry, exit and exceptions."""
        def loggedFunc( *args, **kw ):
           print "enter", aFunc.__name__
           try:
              result= aFunc( *args, **kw )
           except Exception, e:
              print "exception", aFunc.__name__, e
              raise
           print "exit", aFunc.__name__
           return result
           loggedFunc.__name__= aFunc.__name__
           loggedFunc.__doc__= aFunc.__doc__
           return loggedFunc
  </code></pre>
  
  <p>And here is my sample test code :</p>
  
  <pre><code>from custom_logger import Logger
  
  class Test(object):
     @Logger('Test')
     def testP(self):
        print "hello"
  a = Test()
  a.testP()
  </code></pre>
  
  <p>I am getting following error :
  Traceback (most recent call last):
    File "test.py", line 13, in 
      a.testP()
  TypeError: 'NoneType' object is not callable</p>
  
  <p>So can any one point out what am I missing ?</p>
  
  <p>I have followed this link for <a href="https://stackoverflow.com/a/2367288/769260">reference</a>.</p>