title: Confusing design pattern when creating a new parameter for the original function while using decorator
body: <p>I'm using a decorator to shorten the functions that uses selected rows and the current row in PyQt-5. Here's the simplified decorator:</p>
  
  <pre><code>def call_with_selected_record(function):
      @functools.wraps(function)
      def wrapper(self):
          selected_rows = self.getSelectedRows()
          if selected_rows:
              function(self, self.currentRow())
  
      return wrapper
  </code></pre>
  
  <p>And the function looks like this:</p>
  
  <pre><code>@call_with_selected_record
  def toggle_selected_records(self, row):
      doSomethingWithRow(row)
      return
  </code></pre>
  
  <p>Here's the confusing part for this design: When I try to use any function that uses this decorator, my IDE shows the row parameter as needed. But row parameter is satisfied by the decorator itself. So, whenever I try to use the <code>toggle_selected_records</code> function, I need to remember how its decorator works. Do I really need to check the wrapper of each decorator? Isn't this a bit confusing? Or is this the intended design for decorators? Nevertheless I came up with these solutions:</p>
  
  <p>1-)Add this line to all functions that uses the same decorator:</p>
  
  <pre><code>row=self.currentRow()
  </code></pre>
  
  <p>So the function looks like this after the change:</p>
  
  <pre><code>@call_with_selected_record
  def toggle_selected_records(self):
      row=self.currentRow()
      doSomethingWithRow(row)
      return
  </code></pre>
  
  <p>But this solution adds one line to all functions unnecessarily. It's redundant and beats the purpose of having a decorator.</p>
  
  <p>2-)Replace all the row keywords in functions with <code>args[1]</code>. So the function looks like this after the change:</p>
  
  <pre><code>@call_with_selected_record
  def toggle_selected_records(self, *args):
      doSomethingWithRow(args[1])
      return
  </code></pre>
  
  <p>This doesn't add any new lines to the function and eliminates the row parameter. But it creates a new confusion: *args doesn't do anything and it gives an error when a parameter is passed because of the wrapper. This solution also decreases the readability.</p>
  
  <p>So, in short, I don't want to have a row parameter for the original function but want to use the row information that's provided by the decorator without adding something redundant to each function. What's the ultimate solution to this issue?</p>