title: Python decorator in a class: missing required positional arguments:
body: <pre><code>class Something:
      def __init__(self, ...):
         ...
  
      def update(self):
         ...
  
      def add_update(self, func):
        def fct(*args, **kwargs):
            self.update()
            func(*args, **kwargs)
        return fct 
  
      @add_update
      def method(self, some_parameter):
         ...
  </code></pre>
  <p>So basically I have this class, and I want to call the function &quot;update()&quot; automatically before I call a method from the class. But I get this error:</p>
  <pre><code>TypeError: add_update() missing 1 required positional argument: 'func'
  </code></pre>
  <p>I don't really understand what's wrong here, also I saw some tutorials on the internet where they did something similar and it was working. Can someone explain me what's wrong here and how do I fix it?</p>