title: Python - parameter of an object and its value as argument of a function
body: <p>I want to create a generic function that takes as argument different kind of objects which have different types of parameters, like this :</p>
  
  <pre><code>def func(obj, param, param_values):
      for param_value in param_values:
          obj.setParam(param=param_value)
          # do some stuff
      end
  </code></pre>
  
  <p>Now I would like to call that function with different objects, which take different parameters names, as such:</p>
  
  <pre><code>func(obj1(), width, {1,2,3,4})
  func(obj2(), height, {4,5,6})
  </code></pre>
  
  <p>However, when I write it this way, I have an error  saying that 'param' is not a parameter of obj1 and obj2.</p>
  
  <p>How can I write my function such that it's the value of 'param' that is read and not the word 'param'?
  Same goes for 'param_value' as I'm anticipating that it could lead to the same problem.</p>