title: Best approach to pass and handle arguments to function
body: <p>After some reading, I found myself struggling with two different approaches to pass a list of arguments to a function. I read some indications. That's what I figured out so far:</p>
  
  <p>Actual code:</p>
  
  <p>file caller.py:</p>
  
  <pre><code>import worker
  worker.version_check(iserver,login,password,proxyUser,proxyPass,
    proxyServer,packageInfo)
  
  worker.version_get(iserver,login,password,proxyUser,proxyPass,
    proxyServer,packageInfo)
  
  worker.version_send(iserver,login,password,proxyUser,proxyPass,
    proxyServer,packageInfo)
  </code></pre>
  
  <p>File: worker.py:</p>
  
  <pre><code>def version_check(iserver,login,password,proxyUser,proxyPass,proxyServer,service):
      #code and more code
  
  def version_get(iserver,login,password,proxyUser,proxyPass,proxyServer,service):
       #code and more code
  
  def version_send(iserver,login,password,proxyUser,proxyPass,proxyServer,service):
      #code and more code
  </code></pre>
  
  <p>And now I have:</p>
  
  <p>file caller.py:</p>
  
  <pre><code>import worker
  args = (env, family, host, password, prefix, proxyServer,
          proxyUser, proxyPass, option, jokerVar
         )
  worker.version_check(*args)
  worker.version_get(*args)
  worker.version_send(*args)
  </code></pre>
  
  <p>File: worker.py:</p>
  
  <pre><code>def version_check(*args):
    env = args[0]
    family = args[1]
    host = args[2]
    password = args[3]
    prefix = args[4]
    proxyServer = args[5]
    proxyUser = args[6]
    proxyPass = args[7]
    option = args[8]
    jokerVar = args[9]
  
    #code and more code
  
  def version_get((*args):
    env = args[0]
    family = args[1]
    host = args[2]
    password = args[3]
    prefix = args[4]
    proxyServer = args[5]
    proxyUser = args[6]
    proxyPass = args[7]
    option = args[8]
    jokerVar = args[9]
  
    #code and more code
  
  def version_send(*args):
    env = args[0]
    family = args[1]
    host = args[2]
    password = args[3]
    prefix = args[4]
    proxyServer = args[5]
    proxyUser = args[6]
    proxyPass = args[7]
    option = args[8]
    jokerVar = args[9]
  
    #code and more code
  </code></pre>
  
  <p>Using the old approach (actual code) I believe it is more "friendly" to call a function in one line only (as you can see on worker.py). But, using the new approach, I think the code get more extensive because for each function I have to define all the same variables. But is this the best practice? I'm still learning Python on a slow curve, so, sorry for any mistakes in the code.</p>
  
  <p>And one important thing, most of the variables are retrieved from a database, so they are not stactic.</p>