title: passing a dictionary by reference instead of using eval / how to pass a variable number of arguments
body: <p>I was reading some questions about not to use exec or eval in python code.</p>
  
  <p>I currently have a python web program based on pyramid and it takes some variables from a form and calls a function. All the argument of this function or optional, thus more or less what I do is</p>
  
  <pre><code>command = 'function_to_be_called ('
  
  if optional_variable_in_form in request.params :
      command += 'optional_variable=optional_variable_in_form'
  
  command += ')'
  
  i = eval (command)
  </code></pre>
  
  <p>I am trying to enhance my application and I am trying to replace eval with something else. I found <a href="https://stackoverflow.com/questions/1933451/why-should-exec-and-eval-be-avoided/1933703#1933703">this answer</a>, where the author suggests to pass a dictionary by reference instead of using my solution.</p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>do you think it's a good way to go?</li>
  <li>can I always pass a dictionary as proposed by the author to any function?</li>
  <li>I find quite ofter the **, but I don't understand well what it does. Can you give me a hint about it or suggest a good page where I can study about it?</li>
  </ol>