Python3.4 **kwargs, unexpected keyword argument
<p>I have a dictionary of functions, all of which use 1 or 2 optional arguments. I want to iterate through this dictionary and pass both arguments to each iterated function, and have the functions that only need 1 argument to ignore the second. In these cases, however, I get an unexpected keyword argument error. </p>

<pre><code>def getNumFrames(self, **kwargs):
    return len(self.x)

def getConcentration(self, **kwargs):
    if ((not gradient) or (not maxX)):
        return 0
    return (gradient / maxX) * self.x[0]

fields = {'numFrames': getNumFrames, 'concentration': getConcentration}


for field, fieldFunction in fields.items():
        for track in tracks:
             fieldFunction(object, maxX = 10, gradient = 2)
</code></pre>

<p>In this example, getConcentration would work, but getFrames would say maxX is an unexpected keyword.</p>

<p>*I edited my post to include my actual minimalist code, as was suggested.</p>