Python: Passing a list of function names and parameters to a class instance
<p>I've defined a class that takes a list of the form [fname1,[parameters1],fname2,[parameters2],...] as parameter for the creation of an instance.</p>

<p>The idea is for the instance to execute all functions in the list at once, passing them their respective parameters - which works just fine as is, but the implementation I came up with is incredibly ugly.
It looks something like this:</p>

<pre><code># (The input list is split up and transformed into two lists -
# one containing the function names as strings, the other one containing tuples)
# (It then runs a for-loop containing the following statement)

exec '%s%s'%(fname[i],repr(parameter_tuple[i]))
</code></pre>

<p>Which outputs and runs 'fname(parameters,more_parameters,and,so,on)', just as it should do.</p>

<p>I don't know why, but since I coded this, I consequently get the idea that I deserve a really good beating for it... although it works, I just <b>know</b> there has to be a less ugly implementation.
Anyone willing to help me see it? Or maybe to beat me up a bit? ;-)</p>
