title: python: why use a wrapper in decorator?
body: <pre><code>def synchronized(func):
      """Decorator for storage-access methods, which synchronizes on a threading
      lock. The parent object must have 'is_closed' and '_sync_lock' attributes.
      """
  
      @wraps(func)
      def synchronized_wrapper(self, *args, **kwargs):
          with self._sync_lock:
             return func(self, *args, **kwargs)
  
      return synchronized_wrapper
  </code></pre>
  
  <p>the code is in whoosh/src/util.py,I can't understand the synchronized_wrapper's effect and the parameters in synchronized_wrapper(self, *args, **kwargs) from where. Can anyone give me some pointers?</p>