title: Inherit wrapper from abstract method
body: <p>I would like to systematically wrap some overriden method of a base class.</p>
  
  <p>I am using <code>ABC</code> for the base class. I tried to wrap the <code>@abstractmethod</code>, putting the annotation before or after, but it doesn’t work. As I understand it, the the whole wrapped method is overriden.</p>
  
  <pre class="lang-py prettyprint-override"><code>from functools import wraps
  from abc import ABC, abstractmethod
  
  def print_before(func):
      @wraps(func)
      def out(*args, **kwargs):
          print('Hello')
          return func(*args, **kwargs)
  
      return out
  
  class Base(ABC):
      @print_before
      @abstractmethod
      def test(self):
          pass
  
  class Extend(Base):
      def test(self):
          print('World')
  </code></pre>
  
  <p>Here is what happens when we test:</p>
  
  <pre class="lang-py prettyprint-override"><code>Extend().test()
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>World
  </code></pre>
  
  <p>Desired:</p>
  
  <pre><code>Hello
  World
  </code></pre>
  
  <p>I guess I’m not using the right method to get such behavior. What would be a nice pythonic way to run some code before and after an overriden method?</p>